From abce2d8d6c8787ce6eba336fe093759110b015f5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 1 Mar 2020 17:21:06 +0000 Subject: [PATCH] Docs: Synchronize parameter descriptions for conditional tags with their `WP_Query` counterpart methods. See #48354, #48303. Built from https://develop.svn.wordpress.org/trunk@47401 git-svn-id: http://core.svn.wordpress.org/trunk@47188 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-query.php | 37 +++++++++++++++++++++++----------- wp-includes/query.php | 37 +++++++++++++++++++++++----------- wp-includes/version.php | 2 +- 3 files changed, 51 insertions(+), 25 deletions(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index f503407a8a..c2c38a0695 100644 --- a/wp-includes/class-wp-query.php +++ b/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/wp-includes/query.php b/wp-includes/query.php index 4682e51662..705bbb22c6 100644 --- a/wp-includes/query.php +++ b/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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 9c43ca59e8..8a311c631d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-beta3-47400'; +$wp_version = '5.4-beta3-47401'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.