WP::set_query_var()publicWP 2.3.0

Sets the value of a query variable.

Method of the class: WP{}

No Hooks.

Return

null. Nothing (null).

Usage

global $wp;
$wp->set_query_var( $key, $value );
$key(string) (required)
Query variable name.
$value(mixed) (required)
Query variable value.

Changelog

Since 2.3.0 Introduced.

WP::set_query_var() code WP 6.5.2

public function set_query_var( $key, $value ) {
	$this->query_vars[ $key ] = $value;
}