[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
Tue Mar 26 22:51:54 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 commit  |
-----------------------------------------------+------------------

Comment (by wonderboymusic):

 Updated patch - `the_image()` will now return HTML and remove the found
 image from the content when present, even when the image is the result of
 an Insert Into HTML image attachment.

 Few things left to do, and why this is a nightmare:

 - Found an image, the image is from the Media Library, but the image's
 post parent is another post.
 - The found image is wrapped in a link that could either be the image
 `src` or the attachment page
 - All of this nonsense could be wrapped in a caption shortcode
 - Even more awesome, have to loop through every possible size of the image

 Probably have to do the following:
 - Extract `[caption]`s, and for each one, look for the existence of the
 image URL in all of its sizes, also looping through the attachment URLs
 (they will be in the same `$urls` array) - if the URL is present, remove
 the `[caption]`
 - Do the same, but for `<a>` then `<img>`

 Brutal.

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


More information about the wp-trac mailing list