WP_Query::get() – Retrieves the value of a query variable.

You appear to be a bot. Output may be restricted

Description

Retrieves the value of a query variable.

Usage

$mixed = WP_Query::get( $query_var, $default_value );

Parameters

$query_var
( string ) required – Query variable key.
$default_value
( mixed ) optional – Optional. Value to return if the query variable is not set. Default empty string.

Returns

mixed Contents of the query variable.

Source

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


Lines:

1 to 8 of 8
  public function get( $query_var, $default_value = '' ) {
    if ( isset( $this->query_vars[ $query_var ] ) ) {
      return $this->query_vars[ $query_var ];
    }

    return $default_value;
  }
 

 View on GitHub View on Trac