Skip to content

Commit

Permalink
Media: Fix inaccurate docs for wp_attachment_is().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
joedolson committed Jan 12, 2024
1 parent efc2d9e commit 15cbfd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -6665,9 +6665,9 @@ function wp_get_attachment_thumb_url( $post_id = 0 ) {
*
* @since 4.2.0
*
* @param string $type Attachment type. Accepts 'image', 'audio', or 'video'.
* @param string $type Attachment type. Accepts `image`, `audio`, `video`, or a file extension.
* @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.
* @return bool True if an accepted type or a matching file extension, false otherwise.
*/
function wp_attachment_is( $type, $post = null ) {
$post = get_post( $post );
Expand Down

0 comments on commit 15cbfd5

Please sign in to comment.