From 6c33566c054e93010900550ecb4ccd9c45e7daca Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 1 Mar 2020 17:19:58 +0000 Subject: [PATCH] Docs: Synchronize parameter descriptions for conditional tags with their `WP_Query` counterpart methods. See #48354, #48303. git-svn-id: https://develop.svn.wordpress.org/trunk@47401 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-query.php | 37 ++++++++++++++++++++---------- src/wp-includes/query.php | 37 ++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php index f503407a8a..c2c38a0695 100644 --- a/src/wp-includes/class-wp-query.php +++ b/src/wp-includes/class-wp-query.php @@ -3608,7 +3608,8 @@ class WP_Query { * * @since 3.1.0 * - * @param string|string[] $post_types Optional. Post type or array of posts types to check against. + * @param string|string[] $post_types Optional. Post type or array of posts types + * to check against. Default empty. * @return bool */ public function is_post_type_archive( $post_types = '' ) { @@ -3630,7 +3631,8 @@ class WP_Query { * * @since 3.1.0 * - * @param int|string|int[]|string[] $attachment Optional. Attachment ID, title, slug, or array of such to check against. + * @param int|string|int[]|string[] $attachment Optional. Attachment ID, title, slug, or array of such + * to check against. Default empty. * @return bool */ public function is_attachment( $attachment = '' ) { @@ -3664,7 +3666,8 @@ class WP_Query { * * @since 3.1.0 * - * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such to check against. + * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such + * to check against. Default empty. * @return bool */ public function is_author( $author = '' ) { @@ -3699,7 +3702,8 @@ class WP_Query { * * @since 3.1.0 * - * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such to check against. + * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such + * to check against. Default empty. * @return bool */ public function is_category( $category = '' ) { @@ -3734,7 +3738,8 @@ class WP_Query { * * @since 3.1.0 * - * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such to check against. + * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such + * to check against. Default empty. * @return bool */ public function is_tag( $tag = '' ) { @@ -3776,8 +3781,11 @@ class WP_Query { * @global array $wp_taxonomies * * @param string|string[] $taxonomy Optional. Taxonomy slug or slugs to check against. - * @param int|string|int[]|string[] $term Optional. Term ID, name, slug, or array of such to check against. - * @return bool True for custom taxonomy archive pages, false for built-in taxonomies (category and tag archives). + * Default empty. + * @param int|string|int[]|string[] $term Optional. Term ID, name, slug, or array of such + * to check against. Default empty. + * @return bool True for custom taxonomy archive pages, false for built-in taxonomies + * (category and tag archives). */ public function is_tax( $taxonomy = '', $term = '' ) { global $wp_taxonomies; @@ -3854,7 +3862,8 @@ class WP_Query { * * @since 3.1.0 * - * @param string|array $feeds Optional feed types to check. + * @param string|string[] $feeds Optional. Feed type or array of feed types + * to check against. Default empty. * @return bool */ public function is_feed( $feeds = '' ) { @@ -3969,7 +3978,8 @@ class WP_Query { * * @since 3.1.0 * - * @param int|string|array $page Optional. Page ID, title, slug, path, or array of such. Default empty. + * @param int|string|array $page Optional. Page ID, title, slug, path, or array of such + * to check against. Default empty. * @return bool Whether the query is for an existing single page. */ public function is_page( $page = '' ) { @@ -4075,7 +4085,8 @@ class WP_Query { * * @since 3.1.0 * - * @param int|string|array $post Optional. Post ID, title, slug, path, or array of such. Default empty. + * @param int|string|array $post Optional. Post ID, title, slug, path, or array of such + * to check against. Default empty. * @return bool Whether the query is for an existing single post. */ public function is_single( $post = '' ) { @@ -4124,8 +4135,10 @@ class WP_Query { * * @since 3.1.0 * - * @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. + * @param string|array $post_types Optional. Post type or array of post types + * to check against. Default empty. + * @return bool Whether the query is for an existing single post + * or any of the given post types. */ public function is_singular( $post_types = '' ) { if ( empty( $post_types ) || ! $this->is_singular ) { diff --git a/src/wp-includes/query.php b/src/wp-includes/query.php index 4682e51662..705bbb22c6 100644 --- a/src/wp-includes/query.php +++ b/src/wp-includes/query.php @@ -172,7 +172,8 @@ function is_archive() { * * @global WP_Query $wp_query WordPress Query object. * - * @param string|array $post_types Optional. Post type or array of posts types to check against. + * @param string|string[] $post_types Optional. Post type or array of posts types + * to check against. Default empty. * @return bool */ function is_post_type_archive( $post_types = '' ) { @@ -197,7 +198,8 @@ function is_post_type_archive( $post_types = '' ) { * * @global WP_Query $wp_query WordPress Query object. * - * @param int|string|array|object $attachment Attachment ID, title, slug, or array of such. + * @param int|string|int[]|string[] $attachment Optional. Attachment ID, title, slug, or array of such + * to check against. Default empty. * @return bool */ function is_attachment( $attachment = '' ) { @@ -225,7 +227,8 @@ function is_attachment( $attachment = '' ) { * * @global WP_Query $wp_query WordPress Query object. * - * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such to check against. + * @param int|string|int[]|string[] $author Optional. User ID, nickname, nicename, or array of such + * to check against. Default empty. * @return bool */ function is_author( $author = '' ) { @@ -253,7 +256,8 @@ function is_author( $author = '' ) { * * @global WP_Query $wp_query WordPress Query object. * - * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such to check against. + * @param int|string|int[]|string[] $category Optional. Category ID, name, slug, or array of such + * to check against. Default empty. * @return bool */ function is_category( $category = '' ) { @@ -281,7 +285,8 @@ function is_category( $category = '' ) { * * @global WP_Query $wp_query WordPress Query object. * - * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such to check against. + * @param int|string|int[]|string[] $tag Optional. Tag ID, name, slug, or array of such + * to check against. Default empty. * @return bool */ function is_tag( $tag = '' ) { @@ -314,8 +319,11 @@ function is_tag( $tag = '' ) { * @global WP_Query $wp_query WordPress Query object. * * @param string|string[] $taxonomy Optional. Taxonomy slug or slugs to check against. - * @param int|string|int[]|string[] $term Optional. Term ID, name, slug, or array of such to check against. - * @return bool True for custom taxonomy archive pages, false for built-in taxonomies (category and tag archives). + * Default empty. + * @param int|string|int[]|string[] $term Optional. Term ID, name, slug, or array of such + * to check against. Default empty. + * @return bool True for custom taxonomy archive pages, false for built-in taxonomies + * (category and tag archives). */ function is_tax( $taxonomy = '', $term = '' ) { global $wp_query; @@ -389,7 +397,8 @@ function is_day() { * * @global WP_Query $wp_query WordPress Query object. * - * @param string|array $feeds Optional feed types to check. + * @param string|string[] $feeds Optional. Feed type or array of feed types + * to check against. Default empty. * @return bool */ function is_feed( $feeds = '' ) { @@ -560,7 +569,8 @@ function is_month() { * * @global WP_Query $wp_query WordPress Query object. * - * @param int|string|array $page Optional. Page ID, title, slug, or array of such. Default empty. + * @param int|string|array $page Optional. Page ID, title, slug, or array of such + * to check against. Default empty. * @return bool Whether the query is for an existing single page. */ function is_page( $page = '' ) { @@ -705,7 +715,8 @@ function is_search() { * * @global WP_Query $wp_query WordPress Query object. * - * @param int|string|array $post Optional. Post ID, title, slug, or array of such. Default empty. + * @param int|string|array $post Optional. Post ID, title, slug, or array of such + * to check against. Default empty. * @return bool Whether the query is for an existing single post. */ function is_single( $post = '' ) { @@ -737,8 +748,10 @@ function is_single( $post = '' ) { * * @global WP_Query $wp_query WordPress Query object. * - * @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. + * @param string|array $post_types Optional. Post type or array of post types + * to check against. Default empty. + * @return bool Whether the query is for an existing single post + * or any of the given post types. */ function is_singular( $post_types = '' ) { global $wp_query;