[wp-trac] [WordPress Trac] #24070: [embed] from structured video/audio post format not working with post_formats_compat.

WordPress Trac noreply at wordpress.org
Mon Apr 15 15:36:38 UTC 2013


#24070: [embed] from structured video/audio post format not working with
post_formats_compat.
--------------------------+--------------------
 Reporter:  jbobich       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.6
Component:  Post Formats  |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+--------------------

Comment (by kovshenin):

 This is interesting, and not limited to post formats, but the `[embed]`
 shortcode with audio and video files. The problem lies within the
 `WP_Embed->shortcode` method, which calls the `wp_audio_embed` and
 `wp_video_embed` functions, both of which return the URL, and not the
 embedded media, because `WP_Embed->shortcode` runs when all other
 shortcodes are not registered yet.

 The reason it "works" is that the resulting URL is picked up by
 `WP_Embed->autoembed` and parsed again using `wp_audio_embed` or
 `wp_video_embed`, so if there's anything else on the same line that
 doesn't match the audio/video regexes, it fails. Even worse is when the
 resulting URL contains a `</div>` like in the content produced by the
 audio/video formats compat code. This breaks the theme's markup because
 both embed handlers don't escape the URL.

 [attachment:24070.2.diff] makes both embed handlers return the (undone)
 shortcode, regardless of whether the shortcode has been registered or not.

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


More information about the wp-trac mailing list