[wp-trac] [WordPress Trac] #24202: Self-explanatory argument values for new media functions

WordPress Trac noreply at wordpress.org
Thu Jul 11 00:24:16 UTC 2013


#24202: Self-explanatory argument values for new media functions
------------------------------------+--------------------
 Reporter:  SergeyBiryukov          |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  high                    |   Milestone:  3.6
Component:  Media                   |     Version:  trunk
 Severity:  major                   |  Resolution:
 Keywords:  dev-feedback has-patch  |
------------------------------------+--------------------

Comment (by nacin):

 Replying to [comment:17 DrewAPicture]:
 > Replying to [comment:16 nacin]:
 >
 > I'd like to make a case for keeping the shortcode parsing logic in
 `get_content_media()`, maybe rolling it into something different like
 `get_shortcodes_in_content()`. It would be a good compliment to
 `get_media_embedded_in_content()` (media tags), and
 `get_images_from_content()` (images). Shortcodes, media tags, images.
 >
 > There are many many more shortcodes out there than audio or video and I
 think keeping this logic would open some doors to some other interesting
 use cases, regardless of whether it's used by core or not.

 In general I agree, but this wasn't really an API designed for media use,
 let alone generic use. It was designed around the fairly crazy needs for
 PFUI. If it's going to be in core as a nifty shortcode utility, we should
 try that in 3.7. We already added shortcode_exists() and has_shortcode()
 to 3.6, that's a good start in making this better for people.

 > Finally, I'd like to see us at least make that type array in
 `get_embedded_media|get_media_embedded_in_content()` filterable if we're
 going to remove the `$type` parameter.

 Sure, it can gain `$type = null` as a second argument, with the ability to
 pass an array (intersected with those specified in the function).

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24202#comment:18>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list