WP::add_query_var
Adds a query variable to the list of public query variables.
Method of the class: WP{}
No Hooks.
Returns
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() WP::add query var code WP 6.8.3
public function add_query_var( $qv ) {
if ( ! in_array( $qv, $this->public_query_vars, true ) ) {
$this->public_query_vars[] = $qv;
}
}