WP_Query::set() public WP 1.5.0
Sets the value of a query variable.
{} It's a method of the class: WP_Query{}
No Hooks.
Return
Null. Nothing.
Usage
global $wp_query; $wp_query->set( $query_var, $value );
- $query_var(string) (required)
- Query variable key.
- $value(mixed) (required)
- Query variable value.
Changelog
Since 1.5.0 | Introduced. |
Code of WP_Query::set() WP Query::set WP 5.6
public function set( $query_var, $value ) {
$this->query_vars[ $query_var ] = $value;
}