From dc00393c1f774ad3affc6d568fc0a412528da48c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 29 Jun 2020 11:18:37 +0000 Subject: [PATCH] Docs: Document the return value of `wp_get_attachment_metadata()` using hash notation. Props stevenlinx. Fixes #50505. git-svn-id: https://develop.svn.wordpress.org/trunk@48212 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index e196d09726..1ab5ab1501 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -5898,13 +5898,22 @@ function wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file ) { } /** - * Retrieve attachment meta field for attachment ID. + * Retrieves attachment metadata for attachment ID. * * @since 2.1.0 * * @param int $attachment_id Attachment post ID. Defaults to global $post. * @param bool $unfiltered Optional. If true, filters are not run. Default false. - * @return mixed Attachment meta field. False on failure. + * @return array|false { + * Attachment metadata. False on failure. + * + * @type int $width The width of the attachment. + * @type int $height The height of the attachment. + * @type string $file The file path relative to `wp-content/uploads`. + * @type array $sizes Keys are size slugs, each value is an array containing + * 'file', 'width', 'height', and 'mime-type'. + * @type array $image_meta Image metadata. + * } */ function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) { $attachment_id = (int) $attachment_id; @@ -5933,7 +5942,7 @@ function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) { } /** - * Update metadata for an attachment. + * Updates metadata for an attachment. * * @since 2.1.0 *