mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Docs: Add documentation to get_query_var()
and WP_Query::get()
for the optional $default
argument, introduced in 3.9 in [27304].
Props swissspidy. Fixes #33856. Built from https://develop.svn.wordpress.org/trunk@34284 git-svn-id: http://core.svn.wordpress.org/trunk@34248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9f61845204
commit
05f4e52541
@ -15,12 +15,13 @@
|
||||
* Retrieve variable in the WP_Query class.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 3.9.0 The `$default` argument was introduced.
|
||||
*
|
||||
* @global WP_Query $wp_query
|
||||
*
|
||||
* @param string $var The variable key to retrieve.
|
||||
* @param mixed $default Value to return if the query variable is not set. Default ''.
|
||||
* @return mixed
|
||||
* @param mixed $default Optional. Value to return if the query variable is not set. Default empty.
|
||||
* @return mixed Contents of the query variable.
|
||||
*/
|
||||
function get_query_var( $var, $default = '' ) {
|
||||
global $wp_query;
|
||||
@ -2358,11 +2359,13 @@ class WP_Query {
|
||||
* Retrieve query variable.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 3.9.0 The `$default` argument was introduced.
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $query_var Query variable key.
|
||||
* @param mixed $default Value to return if the query variable is not set. Default ''.
|
||||
* @return mixed
|
||||
* @param mixed $default Optional. Value to return if the query variable is not set. Default empty.
|
||||
* @return mixed Contents of the query variable.
|
||||
*/
|
||||
public function get( $query_var, $default = '' ) {
|
||||
if ( isset( $this->query_vars[ $query_var ] ) ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34283';
|
||||
$wp_version = '4.4-alpha-34284';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user