[wp-trac] [WordPress Trac] #41802: add wp_attachment_is_audio() and wp_attachment_is_video()
WordPress Trac
noreply at wordpress.org
Thu Aug 16 21:16:42 UTC 2018
#41802: add wp_attachment_is_audio() and wp_attachment_is_video()
-------------------------+------------------------------
Reporter: pbiron | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------------------
Comment (by pbiron):
Replying to [comment:4 mikeschroder]:
> I personally prefer the generic nature of `wp_attachment_is()` (it looks
like this was an intentional move) to having a separate function each of
many eventual file types.
Yes, I think the introduction of `wp_attachment_is()` was intentional in
4.2.0...and `wp_attachment_is_image()` was changed to be a simple wrapper
around that in 4.2.0.
> Is there a particular reason it'd be helpful to have functions for
these, specifically?
As I said, the reason is consistency...why have `wp_attachment_is_image()`
but not these others?
I'd be fine with deprecating `wp_attachment_is_image()`, but if it's not
going to be deprecated then I think the others should be added.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/41802#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list