[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
Mon Mar 25 20:58:10 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 |
----------------------------------------+------------------
Comment (by lancewillett):
@wonderboymusic -- two questions as we dig into integrating this into
Twenty Thirteen.
1. For `get_content_images()` and `get_content_image()` could we add an
option to return the full <img /> HTML string instead of just the `src`
attribute value?
Right now we'll constrain the display with CSS, but ideally we'd be able
to use the HTML that was inserted into the editor so we get the correctly
sized `img` output HTML without having to rebuild it.
Or, even better: return the attachment IDs of the images, if the images
strings looks like a WP attachment. That way we can use
`wp_get_attachment_image()` on the image instead of a) trusting the
returned HTML and b) trying to build the image HTML string from scratch.
Reasoning: In Twenty Thirteen after we get the bare image src URL we have
to turn around and rebuild an `img` tag again.
2. `get_content_media()` -- should this function be outputting the final
HTML or just returning bare URLs?
{{{
@return array A list of lists. Each item has a list of sources
corresponding
* to a [{media type}]'s primary src and specified fallbacks
}}}
Looks to me like this is only returning a URL now, right? We get the
"Primary src" back. (Also, what would be "specified callbacks" here)?
Reasoning: In Twenty Thirteen after we get the bare URL we have to then
turn around and re-parse with `wp_oembed_get()` or similar to make it into
the correct output HTML again.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23572#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list