YouTube oEmbed and privacy-enhanced mode

At the moment WordPress only recognises youtube.com/watch, youtube.com/playlist and youtu.be. However there is wp_oembed_add_provider; try something like wp_oembed_add_provider( ‘#http://(www\.)?youtube-nocookie\.com/embed.*#i’, ‘http://www.youtube-nocookie.com/oembed’, true ); (untested sorry). You could even overwrite the existing providers to redirect to -nocookie and then use the video shortcode as normal. And you can do this with add_filter(‘oembed_providers’, … ); too if you’d … Read more

Is it possible to enqueue the Youtube API script or does it have to be inline?

First, make sure the YT api is enqueued() and added to the footer. function wp_enqueue_scripts__youtube_api() { wp_enqueue_script( ‘yt-player-api’, ‘http://www.youtube.com/player_api’, array(), false, true ); } add_action( ‘wp_enqueue_scripts’, ‘wp_enqueue_scripts__youtube_api’ ); Next, output your div somewhere on the page. <div id=”‘ . $postid . ‘player”></div> Then, hook into wp_footer and make sure you set the priority higher that … Read more

How add class youtube and type/html to oembed code?

You can try this: add_filter( ’embed_oembed_html’, ‘custom_youtube_oembed’ ); function custom_youtube_oembed( $code ){ if( stripos( $code, ‘youtube.com’ ) !== FALSE && stripos( $code, ‘iframe’ ) !== FALSE ) $code = str_replace( ‘<iframe’, ‘<iframe class=”youtube-player” type=”text/html” ‘, $code ); return $code; } to target the YouTube oembed HTML output. When I embed this YouTube link (Kraftwerk) into … Read more

How do I embed youtube videos with https instead of http in the URL?

http://core.trac.wordpress.org/ticket/18719 has a working patch now. Edit: Plugin code to do similar until patch gets in: wp_oembed_add_provider(‘#https://(www\.)?youtube.com/watch.*#i’, ‘http://youtube.com/oembed?scheme=https’, true); wp_oembed_add_provider(‘https://youtu.be/*’, ‘http://youtube.com/oembed?scheme=https’, false );

Use [embed] filter in template files

Use wp_oembed_get( $url ) instead. Make sure you echo it in your template file. So, something like this: <?php // tot necessary to set this but good if $url is coming from a function $url=”https://www.youtube.com/watch?v=jofNR_WkoCE”; // echo the function in your template to render the video echo wp_oembed_get( $url ); ?>

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