From be12798c9a35363578bd75b9641cfda416cd3ceb Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 16 Jul 2016 13:04:01 +0000 Subject: [PATCH] Docs: Correct `$post` parameter name and description for `wp_attachment_is()` and `wp_attachment_is_image()`. Props flixos90. Fixes #37377. git-svn-id: https://develop.svn.wordpress.org/trunk@38068 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 26a588ba23..225f8dbf39 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -5042,12 +5042,12 @@ function wp_get_attachment_thumb_url( $post_id = 0 ) { * * @since 4.2.0 * - * @param string $type Attachment type. Accepts 'image', 'audio', or 'video'. - * @param int|WP_Post $post_id Optional. Attachment ID. Default 0. + * @param string $type Attachment type. Accepts 'image', 'audio', or 'video'. + * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post. * @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 ) ) { +function wp_attachment_is( $type, $post = null ) { + if ( ! $post = get_post( $post ) ) { return false; } @@ -5093,10 +5093,10 @@ function wp_attachment_is( $type, $post_id = 0 ) { * @since 4.2.0 Modified into wrapper for wp_attachment_is() and * allowed WP_Post object to be passed. * - * @param int|WP_Post $post Optional. Attachment ID. Default 0. + * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post. * @return bool Whether the attachment is an image. */ -function wp_attachment_is_image( $post = 0 ) { +function wp_attachment_is_image( $post = null ) { return wp_attachment_is( 'image', $post ); }