WordPress at a glance
function is not described

set_query_var() WP 2.2.0

Set query variable.

No Hooks.

Return

Null. Nothing.

Usage

set_query_var( $var, $value );
$var(string) (required)
Query variable key.
$value(mixed) (required)
Query variable value.

Notes

  • Global. WP_Query. $wp_query WordPress Query object.

Changelog

Since 2.2.0 Introduced.

Code of set_query_var() WP 5.5.1

<?php
function set_query_var( $var, $value ) {
	global $wp_query;
	$wp_query->set( $var, $value );
}