Make WordPress Core

Opened 10 months ago

Last modified 10 months ago

#41802 new enhancement

add wp_attachment_is_audio() and wp_attachment_is_video()

Reported by: pbiron Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9
Component: Media Keywords: has-patch
Focuses: Cc:


Core already has wp_attachment_is_image().

For consistency and convenience, core should also have wp_attachment_is_audio() and wp_attachment_is_video().

Attachments (1)

41802.diff (10.7 KB) - added by pbiron 10 months ago.

Download all attachments as: .zip

Change History (2)

10 months ago

#1 @pbiron
10 months ago

  • Keywords has-patch added

In addition to adding wp_attachment_is_audio() and wp_attachment_is_video(), the patch also replaces all uses of wp_attachment_is( 'audio' ) and wp_attachment_is( 'video' ) with the new functions (except in unit tests, where the new functions are added to the relevant existing tests that use wp_attachment_is()).

Note: See TracTickets for help on using tickets.