WP::add_query_var()publicWP 2.1.0

Adds a query variable to the list of public query variables.

Method of the class: WP{}

No Hooks.

Return

null. Nothing (null).

Usage

global $wp;
$wp->add_query_var( $qv );
$qv(string) (required)
Query variable name.

Changelog

Since 2.1.0 Introduced.

WP::add_query_var() code WP 6.5.2

public function add_query_var( $qv ) {
	if ( ! in_array( $qv, $this->public_query_vars, true ) ) {
		$this->public_query_vars[] = $qv;
	}
}