Used By
Used By | Description |
---|---|
wp-includes/class-wp.php: WP::parse_request() | Parse request to find correct WordPress query. |
Filters the query variables allowed before processing.
Allows (publicly allowed) query vars to be added, removed, or changed prior to executing the query. Needed to allow custom rewrite rules using your own arguments to work, or any other custom query variables you want to be publicly available.
(string[]) The array of allowed query variable names.
This filter allows query vars to be added, removed, or changed prior to executing the query.
function themeslug_query_vars( $qvars ) { $qvars[] = 'custom_query_var'; return $qvars; } add_filter( 'query_vars', 'themeslug_query_vars' );
File: wp-includes/class-wp.php
Version | Description |
---|---|
1.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/query_vars