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

  • Since 3.9.0 The $default argument was introduced.

No Hooks.

Return

Mixed. Contents of the query variable.

Usage

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

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

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

	return $default;
}