wp_removable_query_args

函式
wp_removable_query_args ( No parameters )
返回值
  • (string[]) An array of query variable names to remove from the URL.
定義位置
相關方法
remove_query_argwp_remote_requestwp_reset_queryadd_query_argwp_edit_attachments_query_vars
引入
4.4.0
棄用
-

wp_removable_query_args: 這是一個過濾鉤,允許從URL查詢字串中刪除或修改預設的查詢引數。

返回一個可以從URL中刪除的一次性查詢變數名稱的陣列。

function wp_removable_query_args() {
	$removable_query_args = array(
		'activate',
		'activated',
		'admin_email_remind_later',
		'approved',
		'core-major-auto-updates-saved',
		'deactivate',
		'delete_count',
		'deleted',
		'disabled',
		'doing_wp_cron',
		'enabled',
		'error',
		'hotkeys_highlight_first',
		'hotkeys_highlight_last',
		'ids',
		'locked',
		'message',
		'same',
		'saved',
		'settings-updated',
		'skipped',
		'spammed',
		'trashed',
		'unspammed',
		'untrashed',
		'update',
		'updated',
		'wp-post-new-reload',
	);

	/**
	 * Filters the list of query variable names to remove.
	 *
	 * @since 4.2.0
	 *
	 * @param string[] $removable_query_args An array of query variable names to remove from a URL.
	 */
	return apply_filters( 'removable_query_args', $removable_query_args );
}

常見問題

FAQs
檢視更多 >