Tag Info

New answers tagged


I think the solution is amazingly simple here: You're just missing a single line of code in your ajax callback, namely: global $post; where I assume you're using: $post = get_post( $post_id ); The reason is that there's a global post check in the WP_Embed::shortcode() method. More details in my answer here.


You could try mashing all the patterns together in one big regexp or and then doing a simple line by line parse of the content: function theme_oembed_videos() { global $post; if ( $post && $post->post_content ) { global $shortcode_tags; // Make a copy of global shortcode tags - we'll temporarily overwrite it. ...


Due a bug in get_tag_regex(), this won't work properly. See bug #26674. You can use the get_media_embedded_in_content() function for both shortcode and embedded media (it looks for these HTML tags: audio, video, object, embed, or iframe), just be sure to use content with applied filters and shortcode executed. For example: $post_id = 125; $post = ...


I think there's some weirdness with [embed] shortcodes where you have to run them through WP_Embed::run_shortcode(), eg if ( strpos( $my_content, '[embed]' ) !== false ) { global $wp_embed; $my_content = $wp_embed->run_shortcode( $my_content ); } $my_content = do_shortcode( $my_content ); Update: however as no providers are ...


try to use get_the_content(), like: $my_content = get_the_content(); $my_content = apply_filters('the_content', $my_content);


Use media query for iframe responsive, set an id to iframe tag and set max-width and min-width, and give specific size to this iframe id on different mode size, @media screen and (max-width: 400px) { #res{ width:200px; height:200px; } }


Well this is not exactly a WordPress problem / solution. First you have to either get the video id from the video_site_url post meta or save the YouTube video id in it's own post meta field, maybe youtube_video_id. Next you can get the thumbnail using one of these url http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg ...


Excellent response - just ran into something similar and worked on it a bit more to make it even more generalized: jQuery().ready(function($) { $('.tabs').tabs(); $('.tabs li').not(':first').click(function() { tab_id=$(this).children('a').attr('href'); iframe_id=$(tab_id).children('iframe').attr('id'); if ...

Top 50 recent answers are included