Summery Summery
Retrieve variable in the WP_Query class.
Syntax Syntax
Parameters Parameters
- $var
-
(Required) The variable key to retrieve.
- $default
-
(Optional) Value to return if the query variable is not set.
Default value: ''
Return Return
(mixed) Contents of the query variable.
Source Source
File: wp-includes/query.php
function get_query_var( $var, $default = '' ) { global $wp_query; return $wp_query->get( $var, $default ); }
Advertisement
Changelog Changelog
Version | Description |
---|---|
3.9.0 | The $default argument was introduced. |
1.5.0 | Introduced. |