[wp-trac] [WordPress Trac] #23572: Add functions to parse Audio / Video data out of arbitrary content or a post

WordPress Trac noreply at wordpress.org
Sat Mar 9 06:49:14 UTC 2013


#23572: Add functions to parse Audio / Video data out of arbitrary content or a
post
----------------------------------------+------------------
 Reporter:  wonderboymusic              |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  3.6
Component:  Post Formats                |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |
----------------------------------------+------------------
Changes (by wonderboymusic):

 * keywords:  needs-refresh needs-unit-tests => needs-unit-tests has-patch


Comment:

 > Probably no need for so many functions.

 This is similar to slurping images / galleries from a content blob. There
 are so many different ways it can be in there, we need 6 extraction
 functions, and here they are:

 - `get_post_audio()` - wraps `get_children()`, returns attached audio,
 impl'd in #23282
 - `get_post_video()` - wraps `get_children()`, returns attached video,
 impl'd in #23282
 - `get_content_audio()` - slurps shortcodes out of the passed content and
 returns a list of lists: each shortcode can have multiple `<source>`s (the
 primary audio `<source>` and its fallbacks)
 - `get_content_video()` - slurps shortcodes out of the passed content and
 returns a list of lists: each shortcode can have multiple `<source>`s (the
 primary video `<source>` and its fallbacks)
 - `get_embedded_audio()` - returns a list: slurps embed HTML
 (`<object>`,`<embed>`,`<iframe>`) and HTML5 `<audio>` tags out of content,
 or if the content is a URL or starts with a URL, returns that as well
 - `get_embedded_video()` - returns a list: slurps embed HTML
 (`<object>`,`<embed>`,`<iframe>`) and HTML5 `<video>` tags out of content,
 or if the content is a URL or starts with a URL, returns that as well

 Patch updated. Unit Tests forthcoming.

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


More information about the wp-trac mailing list