WordPress at a glance
function is not described

WP_Query::get() WP 1.5.0

Retrieve query variable.

This is a method of the class: WP_Query

No Hooks.


Mixed. Contents of the query variable.


$WP_Query = new WP_Query();
$var = $WP_Query->get( $query_var, $default );
$query_var(string) (required)
Query variable key.
Value to return if the query variable is not set.
Default: ''


Since 1.5.0 Introduced.
Since 3.9.0 The $default argument was introduced.

Code of WP Query::get: wp-includes/class-wp-query.php WP 5.3.2

public function get( $query_var, $default = '' ) {
	if ( isset( $this->query_vars[ $query_var ] ) ) {
		return $this->query_vars[ $query_var ];

	return $default;