WPDev.one
Core Function
View Source on Trac ↗

get_query_var()

get_query_var( mixed $query_var, mixed $default_value = '' )

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

Parameters 2 required

Name / Type Description
$query_var
string

The variable key to retrieve.

Required
mixed

$default_value Optional. Value to return if the query variable is not set. Default empty string.

Required

Return Value

(mixed)
Contents of the query variable.

Function Information

Since Version
1.5.0
Source File
wp-includes/query.php
Advertisement