[wp-trac] [WordPress Trac] #23149: YouTube Embedding is incorrect for https:// URLs

WordPress Trac noreply at wordpress.org
Sun Jan 12 00:01:25 UTC 2014


#23149: YouTube Embedding is incorrect for https:// URLs
------------------------------------+------------------
 Reporter:  Otto42                  |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  3.9
Component:  Embeds                  |     Version:  3.5
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------

Comment (by adamsilverstein):

 Replying to [comment:19 Otto42]:
 > @adamsilverstein: The shortcode function won't work for testing here
 because you're not in a normal Loop and so there is no global $post
 context setup. The shortcode expects there to be a $post because it uses
 the post_meta to do caching of the oembed result. This is to prevent it
 from retrieving the info from the remote URL every time. Additionally, you
 have to use a real working YouTube URL for it to actually get anything
 back, a fake URL won't have valid response data.
 >
 >
 > `echo wp_oembed_get( 'http://www.youtube.com/watch?v=oHg5SJYRHA0' );`
 >
 > returns:
 >
 > `<iframe width="500" height="375"
 src="http://www.youtube.com/embed/oHg5SJYRHA0?feature=oembed"
 frameborder="0" allowfullscreen></iframe>`
 >
 >

 Great! Thank you for the detailed response. I think I tried wp_oembed_get
 along the way, maybe missed the piece about requiring a valid URL.  I will
 give it another shot...

--
Ticket URL: <https://core.trac.wordpress.org/ticket/23149#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list