A WordPress-centric search engine for devs and theme authors



get_query_var ›

Since1.5.0
Deprecatedn/a
get_query_var ( $var, $default = '' )
Parameters: (2)
  • (string) $var The variable key to retrieve.
    Required: Yes
  • (mixed) $default Optional. Value to return if the query variable is not set. Default empty.
    Required: No
    Default: (empty)
Returns:
  • (mixed) Contents of the query variable.
Defined at:
Codex:
Change Log:
  • 3.9.0

Retrieve variable in the WP_Query class.



Source

function get_query_var( $var, $default = '' ) {
	global $wp_query;
	return $wp_query->get( $var, $default );
}