From f2c9d2851ca262c299b5ea847119f5af64e53a21 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 24 Nov 2020 21:20:36 +0000 Subject: [PATCH] Docs: Various docblock corrections relating to parameter types. See #51800 git-svn-id: https://develop.svn.wordpress.org/trunk@49692 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-site-icon.php | 2 +- src/wp-includes/class-wp-object-cache.php | 2 +- src/wp-includes/pluggable.php | 13 ++++++++++--- src/wp-includes/post.php | 7 +++---- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/wp-admin/includes/class-wp-site-icon.php b/src/wp-admin/includes/class-wp-site-icon.php index 8d991e4c75..b97e8cd527 100644 --- a/src/wp-admin/includes/class-wp-site-icon.php +++ b/src/wp-admin/includes/class-wp-site-icon.php @@ -216,7 +216,7 @@ class WP_Site_Icon { * array of values. * @param int $post_id Post ID. * @param string $meta_key Meta key. - * @param string|array $single Meta value, or an array of values. + * @param bool $single Whether to return only the first value of the specified `$meta_key`. * @return array|null|string The attachment metadata value, array of values, or null. */ public function get_post_metadata( $value, $post_id, $meta_key, $single ) { diff --git a/src/wp-includes/class-wp-object-cache.php b/src/wp-includes/class-wp-object-cache.php index 80d618fc41..37c474c3c5 100644 --- a/src/wp-includes/class-wp-object-cache.php +++ b/src/wp-includes/class-wp-object-cache.php @@ -170,7 +170,7 @@ class WP_Object_Cache { * * @since 3.0.0 * - * @param array $groups List of groups that are global. + * @param string|string[] $groups List of groups that are global. */ public function add_global_groups( $groups ) { $groups = (array) $groups; diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index 68187fcf05..0f984a7e58 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -165,7 +165,7 @@ if ( ! function_exists( 'wp_mail' ) ) : * @param string $subject Email subject * @param string $message Message contents * @param string|array $headers Optional. Additional headers. - * @param string|array $attachments Optional. Files to attach. + * @param string|array $attachments Optional. Paths to files to attach. * @return bool Whether the email contents were sent successfully. */ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { @@ -176,8 +176,15 @@ if ( ! function_exists( 'wp_mail' ) ) : * * @since 2.2.0 * - * @param array $args A compacted array of wp_mail() arguments, including the "to" email, - * subject, message, headers, and attachments values. + * @param array $args { + * Array of the `wp_mail()` arguments. + * + * @type string|string[] $to Array or comma-separated list of email addresses to send message. + * @type string $subject Email subject. + * @type string $message Message contents. + * @type string|string[] $headers Additional headers. + * @type string|string[] $attachments Paths to files to attach. + * } */ $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 947d0477e0..6bd65aecd8 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2743,10 +2743,9 @@ function wp_count_attachments( $mime_type = '' ) { * * @since 3.7.0 * - * @param object $counts An object containing the attachment counts by - * mime type. - * @param string $mime_type The mime type pattern used to filter the attachments - * counted. + * @param object $counts An object containing the attachment counts by + * mime type. + * @param string|string[] $mime_type Array or comma-separated list of MIME patterns. */ return apply_filters( 'wp_count_attachments', (object) $counts, $mime_type ); }