Make WordPress Core

Changeset 57273


Ignore:
Timestamp:
01/12/2024 04:47:03 PM (12 months ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r57239 r57273  
    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 */
    66726672function wp_attachment_is( $type, $post = null ) {
Note: See TracChangeset for help on using the changeset viewer.