get_query_var() – Retrieve variable in the WP_Query class.

You appear to be a bot. Output may be restricted

Description

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

Usage

$mixed = get_query_var( $var, $default );

Parameters

$var
( string ) required – The variable key to retrieve.
$default
( mixed ) optional – Optional. Value to return if the query variable is not set. Default empty.

Returns

mixed Contents of the query variable.

Source

File name: wordpress/wp-includes/query.php
Lines:

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

 View on GitHub View on Trac