Manipulating oembed_dataparse stopped working for YouTube embeds
I think I solved by doing this: add_filter(‘oembed_dataparse’, ‘bolster_oembed_filter’, 0, 2 ); I changed the priority of the add_filter statement to 0, now it works again.
I think I solved by doing this: add_filter(‘oembed_dataparse’, ‘bolster_oembed_filter’, 0, 2 ); I changed the priority of the add_filter statement to 0, now it works again.
Registering a custom embed handler Here’s an example how we can use the wp_embed_register_handler() function in your case: /** * Register an embed handler for myvi videos */ add_action( ‘init’, function() { wp_embed_register_handler( ‘myvi’, ‘#http://www\.myvi\.ru/watch/([a-zA-Z0-9_-]+)$#i’, // <– Adjust this to your needs! ‘myvi_embed_handler’ ); } ); Here we constructed the regular expression in a way … Read more
The shortcode can be used with the src being an URL of a youtube video. To set a placeholder, preview thumbnail use poster, it even works nicely via GUI. In the end it should look somewhat like the bellow example.
You can try the following: /** * Add support for the QuickTime (.mov) video format. */ add_filter( ‘wp_video_extensions’, function( $exts ) { $exts[] = ‘mov’; return $exts; } ); to add the Embed Media Player support for the QuickTime video files. The default supported video formats are: mp4, m4v, webm, ogv, wmv, flv Update: When … Read more
I modified the example you posted from the Codex: /** * Embed support for Forbes videos * * Usage Example: * * http://www.forbes.com/video/5049647995001/ */ add_action( ‘init’, function() { wp_embed_register_handler( ‘forbes’, ‘#http://www\.forbes\.com/video/([\d]+)/?#i’, ‘wp_embed_handler_forbes’ ); } ); function wp_embed_handler_forbes( $matches, $attr, $url, $rawattr ) { $embed = sprintf( ‘<iframe class=”forbes-video” src=”https://players.brightcove.net/2097119709001/598f142b-5fda-4057-8ece-b03c43222b3f_default/index.html?videoId=%1$s” width=”600″ height=”400″ frameborder=”0″ scrolling=”no”></iframe>’, esc_attr( $matches[1] … Read more
If you are on WordPress 3.5 or higher just putting the URL on a separate line should work: https://soundcloud.com/radhanath-swami/offer-the-best-you-have You do not need to use the embed code, WordPress handles the embedding via oEmbed itself. Also have a look at the Codex. EDIT: If you want the small image you probably should have mentioned that … Read more
See the function wp_embed_defaults() in wp-includes/media.php: function wp_embed_defaults() { if ( ! empty( $GLOBALS[‘content_width’] ) ) $width = (int) $GLOBALS[‘content_width’]; if ( empty( $width ) ) $width = 500; $height = min( ceil( $width * 1.5 ), 1000 ); return apply_filters( ’embed_defaults’, compact( ‘width’, ‘height’ ) ); } To change these values filter embed_defaults: add_filter( … Read more
Those are not really arguments like for YouTube, more of arguments for WordPress itself. One way to handle it would be to access your argument later inside of a filter and modify HTML output. Pass in arguments array: wp_oembed_get( ‘http://www.youtube.com/watch?v=’, array( ‘autoplay’ => 1 ) ); And filter: add_filter(‘oembed_result’,’oembed_result’, 10, 3); function oembed_result($html, $url, $args) … Read more
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 );