wpseek.com
A WordPress-centric search engine for devs and theme authors



get_query_var › WordPress Function

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

Retrieves the value of a query variable in the WP_Query class.



Source

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