W3cubDocs

/WordPress

WP::add_query_var( string $qv )

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

Parameters

$qvstringrequired
Query variable name.

Source

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

Changelog

Version Description
2.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp/add_query_var