WP::set_query_var() WordPress Method
The set_query_var() function sets the value of a query variable. This function can be used to set the value of a query variable for the current query. It can also be used to set the value of a query variable for a given WP_Query object.
WP::set_query_var( string $key, mixed $value ) #
Sets the value of a query variable.
Contents
Parameters
- $key
(string)(Required)Query variable name.
- $value
(mixed)(Required)Query variable value.
Source
File: wp-includes/class-wp.php
public function set_query_var( $key, $value ) { $this->query_vars[ $key ] = $value; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |