Trigger wp-embed via JavaScript to refresh iframe preview?

Unfortunately WP Embed isn’t responsible for converting links into iframes. The conversion of links and shortcodes into iframes is implemented by OEmbed and that happens via OEmbed APIs on the_content filter in PHP, not javascript. It’s much more likely that your transitioning to pages that use raw post content rather than processed/rendered content, e.g. templates … Read more

WordPress get_media_embedded

Because print_r prints a readable version of your variable $media, which will be an array as per the documentation for get_media_embedded_in_content(). You see Array ( [0] => [youtube embed] ) in your browser because it’s rendering the HTML of the array element – if you check the source code of your page you would see … Read more

Reusing header.php from Yii application

In your header.php you are probably using wp_title(). This one requires at least two global variables: $wpdb (the get_query_var() call) and $wp_locale, on singular views a global $post object too. So you have to create these variables, or set wp_title() in a conditional, like this: if ( ! empty ( $GLOBALS[‘wpdb’] ) ) wp_title();

Embedding Youtube video on comments

Just add the comments to oEmbed. Here’s a small plugin that you can use as MU-Plugin or normal plugin and that should explain what’s going on pretty well. <?php defined( ‘ABSPATH’ ) or exit; /* Plugin Name: (#105942) oEmbed Comments */ add_filter( ‘comment_text’, ‘wpse_105942_oembed_comments’, 0 ); function wpse_105942_oembed_comments( $comment ) { add_filter( ’embed_oembed_discover’, ‘__return_false’, 999 … Read more

Div around YouTube video

I’m not sure why that’s not working except maybe you need to put the returned stuff in a variable? This is what works for me when I put it in my functions.php file: add_filter( ’embed_oembed_html’, ‘tdd_oembed_filter’, 10, 4 ) ; function tdd_oembed_filter($html, $url, $attr, $post_ID) { $return = ‘<figure class=”video-container”>’.$html.'</figure>’; return $return; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)