set_query_var( string $var, mixed $value )
Sets the value of a query variable in the WP_Query class.
Parameters
- $var
-
(string) (Required) Query variable key.
- $value
-
(mixed) (Required) Query variable value.
Source
File: wp-includes/query.php
function set_query_var( $var, $value ) { global $wp_query; $wp_query->set( $var, $value ); }
Changelog
Version | Description |
---|---|
2.2.0 | Introduced. |
© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/set_query_var