From 170ca3200736d2ad6675d6efc2279f775b261fa2 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 14 Nov 2020 16:35:06 +0000 Subject: [PATCH] Docs: Various docblock corrections and improvements. See #50768 Built from https://develop.svn.wordpress.org/trunk@49597 git-svn-id: http://core.svn.wordpress.org/trunk@49335 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 2 +- wp-includes/class-wp-http-streams.php | 2 +- wp-includes/deprecated.php | 1 + wp-includes/general-template.php | 26 +++++++++++++------------- wp-includes/media.php | 10 +++++----- wp-includes/ms-site.php | 4 ++-- wp-includes/taxonomy.php | 24 ++++++++++++------------ wp-includes/version.php | 2 +- 8 files changed, 36 insertions(+), 35 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index e2f0cb0115..85922eb42f 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -1153,7 +1153,7 @@ function get_tag_link( $tag ) { * * @since 2.3.0 * - * @param int $post_id Post ID. + * @param int|WP_Post $post_id Post ID or object. * @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms * or the post does not exist, WP_Error on failure. */ diff --git a/wp-includes/class-wp-http-streams.php b/wp-includes/class-wp-http-streams.php index 57671c8f86..ce676294a3 100644 --- a/wp-includes/class-wp-http-streams.php +++ b/wp-includes/class-wp-http-streams.php @@ -94,7 +94,7 @@ class WP_Http_Streams { $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify']; if ( $is_local ) { /** - * Filters whether SSL should be verified for local requests. + * Filters whether SSL should be verified for local HTTP API requests. * * @since 2.8.0 * @since 5.1.0 The `$url` parameter was added. diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 44999504dc..09d82f872f 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -1911,6 +1911,7 @@ function get_attachment_icon_src( $id = 0, $fullsize = false ) { } elseif ( $src = wp_mime_type_icon( $post->ID ) ) { // No thumb, no image. We'll look for a mime-related icon instead. + /** This filter is documented in wp-includes/post.php */ $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); $src_file = $icon_dir . '/' . wp_basename($src); } diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 94e2d1b97d..26fe0a3674 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -2585,7 +2585,7 @@ function the_modified_date( $format = '', $before = '', $after = '', $echo = tru * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. - * @return string|false Date the current post was modified. False on failure. + * @return string|int|false Date the current post was modified. False on failure. */ function get_the_modified_date( $format = '', $post = null ) { $post = get_post( $post ); @@ -2605,9 +2605,9 @@ function get_the_modified_date( $format = '', $post = null ) { * @since 2.1.0 * @since 4.6.0 Added the `$post` parameter. * - * @param string|false $the_time The formatted date or false if no post is found. - * @param string $format PHP date format. - * @param WP_Post|null $post WP_Post object or null if no post is found. + * @param string|int|false $the_time The formatted date or false if no post is found. + * @param string $format PHP date format. + * @param WP_Post|null $post WP_Post object or null if no post is found. */ return apply_filters( 'get_the_modified_date', $the_time, $format, $post ); } @@ -2831,7 +2831,7 @@ function the_modified_time( $format = '' ) { * was modified. Accepts 'G', 'U', or PHP date format. * Defaults to the 'time_format' option. * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post. - * @return string|false Formatted date string or Unix timestamp. False on failure. + * @return string|int|false Formatted date string or Unix timestamp. False on failure. */ function get_the_modified_time( $format = '', $post = null ) { $post = get_post( $post ); @@ -2851,10 +2851,10 @@ function get_the_modified_time( $format = '', $post = null ) { * @since 2.0.0 * @since 4.6.0 Added the `$post` parameter. * - * @param string|false $the_time The formatted time or false if no post is found. - * @param string $format Format to use for retrieving the time the post - * was modified. Accepts 'G', 'U', or PHP date format. - * @param WP_Post|null $post WP_Post object or null if no post is found. + * @param string|int|false $the_time The formatted time or false if no post is found. + * @param string $format Format to use for retrieving the time the post + * was modified. Accepts 'G', 'U', or PHP date format. + * @param WP_Post|null $post WP_Post object or null if no post is found. */ return apply_filters( 'get_the_modified_time', $the_time, $format, $post ); } @@ -2908,10 +2908,10 @@ function get_post_modified_time( $format = 'U', $gmt = false, $post = null, $tra * * @since 2.8.0 * - * @param string $time The formatted time. - * @param string $format Format to use for retrieving the time the post was modified. - * Accepts 'G', 'U', or PHP date format. Default 'U'. - * @param bool $gmt Whether to retrieve the GMT time. Default false. + * @param string|int $time Formatted date string or Unix timestamp if `$format` is 'U' or 'G'. + * @param string $format Format to use for retrieving the time the post was modified. + * Accepts 'G', 'U', or PHP date format. Default 'U'. + * @param bool $gmt Whether to retrieve the GMT time. Default false. */ return apply_filters( 'get_post_modified_time', $time, $format, $gmt ); } diff --git a/wp-includes/media.php b/wp-includes/media.php index 7778b6bd1c..8b8b862e5d 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -42,7 +42,7 @@ function wp_get_additional_image_sizes() { * * @since 2.5.0 * - * @global int $content_width + * @global int $content_width * * @param int $width Width of the image in pixels. * @param int $height Height of the image in pixels. @@ -1081,7 +1081,7 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f * * @since 2.8.0 * - * @param array $attr Array of attribute values for the image markup, keyed by attribute name. + * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). * @param WP_Post $attachment Image attachment post. * @param string|int[] $size Requested image size. Can be any registered image size name, or @@ -1109,7 +1109,7 @@ function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @param bool $icon Whether the image should be treated as an icon. - * @param array $attr Array of attribute values for the image markup, keyed by attribute name. + * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). */ return apply_filters( 'wp_get_attachment_image', $html, $attachment_id, $size, $icon, $attr ); @@ -1237,7 +1237,7 @@ function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $imag * @param string $image_src The 'src' of the image. * @param array $image_meta The image meta data as returned by 'wp_get_attachment_metadata()'. * @param int $attachment_id Optional. The image attachment ID. Default 0. - * @return string|bool The 'srcset' attribute value. False on error or when only one source exists. + * @return string|false The 'srcset' attribute value. False on error or when only one source exists. */ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id = 0 ) { /** @@ -1476,7 +1476,7 @@ function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image * Default null. * @param int $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` * is needed when using the image size name as argument for `$size`. Default 0. - * @return string|bool A valid source size value for use in a 'sizes' attribute or false. + * @return string|false A valid source size value for use in a 'sizes' attribute or false. */ function wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $attachment_id = 0 ) { $width = 0; diff --git a/wp-includes/ms-site.php b/wp-includes/ms-site.php index 31d1c7ce99..233283871d 100644 --- a/wp-includes/ms-site.php +++ b/wp-includes/ms-site.php @@ -860,8 +860,8 @@ function wp_uninitialize_site( $site_id ) { * * @since MU (3.0.0) * - * @param string $uploads['basedir'] Uploads path without subdirectory. @see wp_upload_dir() - * @param int $site_id The site ID. + * @param string $basedir Uploads path without subdirectory. @see wp_upload_dir() + * @param int $site_id The site ID. */ $dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $site->id ); $dir = rtrim( $dir, DIRECTORY_SEPARATOR ); diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index b60d593140..7c8463cf00 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -2048,8 +2048,8 @@ function wp_delete_category( $cat_ID ) { * @param int|int[] $object_ids The ID(s) of the object(s) to retrieve. * @param string|string[] $taxonomies The taxonomy names to retrieve terms from. * @param array|string $args See WP_Term_Query::__construct() for supported arguments. - * @return array|WP_Error The requested term data or empty array if no terms found. - * WP_Error if any of the taxonomies don't exist. + * @return WP_Term[]|WP_Error Array of terms or empty array if no terms found. + * WP_Error if any of the taxonomies don't exist. */ function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) { if ( empty( $object_ids ) || empty( $taxonomies ) ) { @@ -2125,11 +2125,11 @@ function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) { * * @since 4.2.0 * - * @param array $terms Array of terms for the given object or objects. - * @param int[] $object_ids Array of object IDs for which terms were retrieved. - * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved. - * @param array $args Array of arguments for retrieving terms for the given - * object(s). See wp_get_object_terms() for details. + * @param WP_Term[] $terms Array of terms for the given object or objects. + * @param int[] $object_ids Array of object IDs for which terms were retrieved. + * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved. + * @param array $args Array of arguments for retrieving terms for the given + * object(s). See wp_get_object_terms() for details. */ $terms = apply_filters( 'get_object_terms', $terms, $object_ids, $taxonomies, $args ); @@ -2144,11 +2144,11 @@ function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) { * * @since 2.8.0 * - * @param array $terms Array of terms for the given object or objects. - * @param int[] $object_ids Array of object IDs for which terms were retrieved. - * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved. - * @param array $args Array of arguments for retrieving terms for the given - * object(s). See wp_get_object_terms() for details. + * @param WP_Term[] $terms Array of terms for the given object or objects. + * @param string $object_ids Comma separated list if object IDs for which terms were retrieved. + * @param string $taxonomies SQL fragment of taxonomy names from which terms were retrieved. + * @param array $args Array of arguments for retrieving terms for the given + * object(s). See wp_get_object_terms() for details. */ return apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 928dc77681..465fcbf598 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta4-49596'; +$wp_version = '5.6-beta4-49597'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.