Skip to content

Commit 15cbfd5

Browse files
committed
Media: Fix inaccurate docs for wp_attachment_is().
Correct the documentation for the `$type` parameter to accept file extensions as well as attachment type groups. Also fix the return description to reflect the change. Props nirav7707, joedolson. Fixes #59698. git-svn-id: https://develop.svn.wordpress.org/trunk@57273 602fd350-edb4-49c9-b593-d223f7449a82
1 parent efc2d9e commit 15cbfd5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wp-includes/post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6665,9 +6665,9 @@ function wp_get_attachment_thumb_url( $post_id = 0 ) {
66656665
*
66666666
* @since 4.2.0
66676667
*
6668-
* @param string $type Attachment type. Accepts 'image', 'audio', or 'video'.
6668+
* @param string $type Attachment type. Accepts `image`, `audio`, `video`, or a file extension.
66696669
* @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post.
6670-
* @return bool True if one of the accepted types, false otherwise.
6670+
* @return bool True if an accepted type or a matching file extension, false otherwise.
66716671
*/
66726672
function wp_attachment_is( $type, $post = null ) {
66736673
$post = get_post( $post );

0 commit comments

Comments
 (0)