From 37ca5609c832d1c0e916e7f2447aff7fdca6b5e6 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 7 Mar 2015 07:08:52 +0000 Subject: [PATCH] Better document parameters and the return for the newly-introduced `wp_attachment_is()`. Also adds a changelog entry to the DocBlock for `wp_attachment_is_image()` to denote that it serves as a wrapper for `wp_attachment_is()` as of 4.2.0. See [31645]. See #25275. git-svn-id: https://develop.svn.wordpress.org/trunk@31659 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 981601bd2c..4732de8b34 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -5071,11 +5071,11 @@ function wp_get_attachment_thumb_url( $post_id = 0 ) { } /** - * Verfify the attachment as being of a specific type + * Verifies an attachment is of a given type. * - * @param string $type Type: image, audio, or video. - * @param int|WP_Post $post_id Optional. Default 0. - * @return bool + * @param string $type Attachment type. Accepts 'image', 'audio', or 'video'. + * @param int|WP_Post $post_id Optional. Attachment ID. Default 0. + * @return bool True if one of the accepted types, false otherwise. */ function wp_attachment_is( $type, $post_id = 0 ) { if ( ! $post = get_post( $post_id ) ) { @@ -5118,9 +5118,10 @@ function wp_attachment_is( $type, $post_id = 0 ) { } /** - * Check if the attachment is an image. + * Checks if the attachment is an image. * * @since 2.1.0 + * @since 4.2.0 Modified into wrapper for wp_attachment_is() * * @param int|WP_Post $post Optional. Attachment ID. Default 0. * @return bool Whether the attachment is an image.