How can I get the [video] shortcode to allow query string parameters?

You got two options. Either you filter your valid video extentions as @birgire recommended. I remember a similar issue for the audio shortcode here. There I found a workaround by allowing the empty audio extension. You could try something similar with the video extensions. Here’s a demo plugin: /** * Allow the empty video extension … Read more

WP REST – video and audio players

Ran into this same issue and I found the answer after many hours and almost giving up. It’s in a bit of code that written to make the Customizer work with playlists. Checkout this comment from /wp-includes/widgets/class-wp-widget-text.php: /** * Enqueue preview scripts. * * These scripts normally are enqueued just-in-time when a playlist shortcode is … Read more

How to handle valueless attributes in shortcodes?

Use 0 and 1 as shortcode values and use that show or hide the HTML attribute. Example with an element input and the attribute required: function input_shortcode( $atts ) { $values = shortcode_atts( array ( ‘type’ => ‘text’, ‘value’ => ”, ‘name’ => ”, ‘id’ => ”, ‘required’ => 0, ), $atts ); $values = … Read more

How to add new embed handler not supported by oembed

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

Show Video in Excerpt

filtering the_excerpt() If you remove_filter( ‘get_the_excerpt’, ‘wp_trim_excerpt’ ) and add your own get_the_excerpt filter you can do this. The default filter (wp_trim_excerpt()) can be found on line 2023 of /wp-includes/formatting.php if you want to just modify that. The extent of what you need to do is just modifying which tags are allowed in strip_tags(). overriding … Read more

Videos via the video shortcode are always 640px wide?

That width is dictated by the $content_width global, defined by the Theme. To change it, you’ll need to hook into after_setup_theme and modify it: function wpse124075_setup_theme() { global $content_width; if ( ! isset( $content_width ) ) { $content_width = 640; // your value here, in pixels } } add_action( ‘after_setup_theme’, ‘wpse124075_setup_theme’ );

Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer

You can filter the HTML output for oEmbed with oembed_result. Now test the HTTP host of the URL for www.youtube.com and add the parameter. The oEmbed result is cached in a post meta field to avoid too many requests. To update old posts I have added an activation helper that clears those cached content for … Read more