WordPress Public and Private Query Parameters
在Get query var: get query varThis post mentions WordPress query variables, WordPress has two types of reserved variables: public_query_vars and private_query_vars
$public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', ' calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', ' category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', ' subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type').
$private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post _mime_type', 'perm', 'comments_per_page').;
For the public query variables public_query_vars, we can directly use the get_query_var function to get the value of the query variables, while the private query variables private_query_vars are used by the WordPress backend, and you can't get the value of these variables through get_query_var.
When creating a custom query variable or adding a URL redirection rule, we can no longer use any of the above variable names, otherwise we will get a 404 or some strange error.