From 572e3ddafb3bc5f22be36de45ac758903c848db6 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Fri, 18 Sep 2015 09:40:51 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@34284 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/query.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index 7bcecf4ad5..5b666a5b31 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -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 ] ) ) {