From 41995176f69b9c49bdfc43fdcb0a7684bbcabe5d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 4 Oct 2021 20:44:02 +0000 Subject: [PATCH] Docs: Miscellaneous inline documentation improvements, including: * Document the post statuses global as an array of `stdClass` objects * Document the taxonomies global as an array of `WP_Taxonomy` objects * Document the return value of the post count functions as `stdClass` objects * Fix some typos See #53399 Built from https://develop.svn.wordpress.org/trunk@51885 git-svn-id: http://core.svn.wordpress.org/trunk@51478 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-nav-menus.php | 2 +- wp-includes/class-wp-query.php | 2 +- wp-includes/functions.php | 2 +- wp-includes/post.php | 26 ++++++++++---------- wp-includes/taxonomy.php | 16 ++++++------ wp-includes/version.php | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index 7eee959ecb..f438e358fd 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -1334,7 +1334,7 @@ final class WP_Customize_Nav_Menus { * * @since 4.7.0 * - * @global array $wp_post_statuses List of post statuses. + * @global stdClass[] $wp_post_statuses List of post statuses. */ public function make_auto_draft_status_previewable() { global $wp_post_statuses; diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 08d0b5cd51..1f9516eec4 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -3855,7 +3855,7 @@ class WP_Query { * * @since 3.1.0 * - * @global array $wp_taxonomies + * @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies. * * @param string|string[] $taxonomy Optional. Taxonomy slug or slugs to check against. * Default empty. diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f75c396328..aa507bb004 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1533,7 +1533,7 @@ function get_num_queries() { * @since 1.0.0 * * @param string $yn Character string containing either 'y' (yes) or 'n' (no). - * @return bool True if yes, false on anything else. + * @return bool True if 'y', false on anything else. */ function bool_from_yn( $yn ) { return ( 'y' === strtolower( $yn ) ); diff --git a/wp-includes/post.php b/wp-includes/post.php index 2487e5b4c2..2bcd72c6d4 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -949,7 +949,7 @@ function get_post_mime_type( $post = null ) { * * @since 2.0.0 * - * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.. + * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post. * @return string|false Post status on success, false on failure. */ function get_post_status( $post = null ) { @@ -1077,7 +1077,7 @@ function _wp_privacy_statuses() { * * @since 3.0.0 * - * @global array $wp_post_statuses Inserts new post status object into the list + * @global stdClass[] $wp_post_statuses Inserts new post status object into the list * * @param string $post_status Name of the post status. * @param array|string $args { @@ -1201,12 +1201,12 @@ function register_post_status( $post_status, $args = array() ) { * * @since 3.0.0 * - * @global array $wp_post_statuses List of post statuses. + * @global stdClass[] $wp_post_statuses List of post statuses. * * @see register_post_status() * * @param string $post_status The name of a registered post status. - * @return object|null A post status object. + * @return stdClass|null A post status object. */ function get_post_status_object( $post_status ) { global $wp_post_statuses; @@ -1223,7 +1223,7 @@ function get_post_status_object( $post_status ) { * * @since 3.0.0 * - * @global array $wp_post_statuses List of post statuses. + * @global stdClass[] $wp_post_statuses List of post statuses. * * @see register_post_status() * @@ -2817,7 +2817,7 @@ function _count_posts_cache_key( $type = 'post', $perm = '' ) { * * @param string $type Optional. Post type to retrieve count. Default 'post'. * @param string $perm Optional. 'readable' or empty. Default empty. - * @return object Number of posts for each status. + * @return stdClass Number of posts for each status. */ function wp_count_posts( $type = 'post', $perm = '' ) { global $wpdb; @@ -2870,11 +2870,11 @@ function wp_count_posts( $type = 'post', $perm = '' ) { * * @since 3.7.0 * - * @param object $counts An object containing the current post_type's post - * counts by status. - * @param string $type Post type. - * @param string $perm The permission to determine if the posts are 'readable' - * by the current user. + * @param stdClass $counts An object containing the current post_type's post + * counts by status. + * @param string $type Post type. + * @param string $perm The permission to determine if the posts are 'readable' + * by the current user. */ return apply_filters( 'wp_count_posts', $counts, $type, $perm ); } @@ -2893,7 +2893,7 @@ function wp_count_posts( $type = 'post', $perm = '' ) { * * @param string|string[] $mime_type Optional. Array or comma-separated list of * MIME patterns. Default empty. - * @return object An object containing the attachment counts by mime type. + * @return stdClass An object containing the attachment counts by mime type. */ function wp_count_attachments( $mime_type = '' ) { global $wpdb; @@ -2912,7 +2912,7 @@ function wp_count_attachments( $mime_type = '' ) { * * @since 3.7.0 * - * @param object $counts An object containing the attachment counts by + * @param stdClass $counts An object containing the attachment counts by * mime type. * @param string|string[] $mime_type Array or comma-separated list of MIME patterns. */ diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 104da64a87..f81af0351e 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -198,7 +198,7 @@ function create_initial_taxonomies() { * * @since 3.0.0 * - * @global array $wp_taxonomies The registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * * @param array $args Optional. An array of `key => value` arguments to match against the taxonomy objects. * Default empty array. @@ -231,7 +231,7 @@ function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) * * @since 2.3.0 * - * @global array $wp_taxonomies The registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * * @param string|string[]|WP_Post $object Name of the type of taxonomy object, or an object (row from posts) * @param string $output Optional. The type of output to return in the array. Accepts either @@ -272,7 +272,7 @@ function get_object_taxonomies( $object, $output = 'names' ) { * * @since 2.3.0 * - * @global array $wp_taxonomies The registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * * @param string $taxonomy Name of taxonomy object to return. * @return WP_Taxonomy|false The Taxonomy Object or false if $taxonomy doesn't exist. @@ -298,7 +298,7 @@ function get_taxonomy( $taxonomy ) { * * @since 3.0.0 * - * @global array $wp_taxonomies The registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * * @param string $taxonomy Name of taxonomy object. * @return bool Whether the taxonomy exists. @@ -356,7 +356,7 @@ function is_taxonomy_hierarchical( $taxonomy ) { * @since 5.4.0 Added the registered taxonomy object as a return value. * @since 5.5.0 Introduced `default_term` argument. * - * @global array $wp_taxonomies Registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies Registered taxonomies. * * @param string $taxonomy Taxonomy key, must not exceed 32 characters. * @param array|string $object_type Object type or array of object types with which the taxonomy should be associated. @@ -507,7 +507,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { * @since 4.5.0 * * @global WP $wp Current WordPress environment instance. - * @global array $wp_taxonomies List of taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies List of taxonomies. * * @param string $taxonomy Taxonomy name. * @return true|WP_Error True on success, WP_Error on failure or if the taxonomy doesn't exist. @@ -684,7 +684,7 @@ function get_taxonomy_labels( $tax ) { * * @since 3.0.0 * - * @global array $wp_taxonomies The registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * * @param string $taxonomy Name of taxonomy object. * @param string $object_type Name of the object type. @@ -726,7 +726,7 @@ function register_taxonomy_for_object_type( $taxonomy, $object_type ) { * * @since 3.7.0 * - * @global array $wp_taxonomies The registered taxonomies. + * @global WP_Taxonomy[] $wp_taxonomies The registered taxonomies. * * @param string $taxonomy Name of taxonomy object. * @param string $object_type Name of the object type. diff --git a/wp-includes/version.php b/wp-includes/version.php index b089285514..0ed3555d35 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51884'; +$wp_version = '5.9-alpha-51885'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.