From 057ba76b2cc22a322aa399181f61a70558155561 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Thu, 24 Sep 2015 16:17:23 +0000 Subject: [PATCH] Docs: Add more explicit optional parameter types and return descriptions in the DocBlocks for `is_page()`, `is_single()`, `is_singular()`. Also adds explicit types and return descriptions to the corresponding `WP_Query` methods: `WP_Query::is_page()`, `WP_Query::is_single()`, and `WP_Query::is_singular()`. Props Shelob9 for the initial patch. Fixes #33907. git-svn-id: https://develop.svn.wordpress.org/trunk@34502 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/query.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index f56bd81e2c..7abd4d4d0e 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -488,8 +488,8 @@ function is_month() { * * @global WP_Query $wp_query Global WP_Query instance. * - * @param mixed $page Page ID, title, slug, or array of such. - * @return bool + * @param int|string|array $page Optional. Page ID, title, slug, or array of such. Default empty. + * @return bool Whether the query is for an existing single page. */ function is_page( $page = '' ) { global $wp_query; @@ -597,8 +597,8 @@ function is_search() { * * @global WP_Query $wp_query Global WP_Query instance. * - * @param mixed $post Post ID, title, slug, or array of such. - * @return bool + * @param int|string|array $post Optional. Post ID, title, slug, or array of such. Default empty. + * @return bool Whether the query is for an existing single post. */ function is_single( $post = '' ) { global $wp_query; @@ -624,8 +624,8 @@ function is_single( $post = '' ) { * * @global WP_Query $wp_query Global WP_Query instance. * - * @param mixed $post_types Optional. Post Type or array of Post Types - * @return bool + * @param string|array $post_types Optional. Post type or array of post types. Default empty. + * @return bool Whether the query is for an existing single post of any of the given post types. */ function is_singular( $post_types = '' ) { global $wp_query; @@ -4406,8 +4406,8 @@ class WP_Query { * * @since 3.1.0 * - * @param mixed $page Page ID, title, slug, path, or array of such. - * @return bool + * @param int|string|array $page Optional. Page ID, title, slug, path, or array of such. Default empty. + * @return bool Whether the query is for an existing single page. */ public function is_page( $page = '' ) { if ( !$this->is_page ) @@ -4499,8 +4499,8 @@ class WP_Query { * * @since 3.1.0 * - * @param mixed $post Post ID, title, slug, path, or array of such. - * @return bool + * @param int|string|array $post Optional. Post ID, title, slug, path, or array of such. Default empty. + * @return bool Whether the query is for an existing single post. */ public function is_single( $post = '' ) { if ( !$this->is_single ) @@ -4545,8 +4545,8 @@ class WP_Query { * * @since 3.1.0 * - * @param mixed $post_types Optional. Post Type or array of Post Types - * @return bool + * @param string|array $post_types Optional. Post type or array of post types. Default empty. + * @return bool Whether the query is for an existing single post of any of the given post types. */ public function is_singular( $post_types = '' ) { if ( empty( $post_types ) || !$this->is_singular )