WordPress 3.6 – New Built-in Video and Audio Shortcodes

I take a peek at WordPress 3.6 which is still in active development by now and I find out there are a bunch of new functions added in wp-includes/media.php.

The video and audio shortcodes catch my attention.

Here is my test.

Shortcode:
[(whitespace)video src=”http://www.test.com/test.mp4″ widht=”300″ height=”640″ poster=”vide shortcode test”(whitespace)]

The poster is video preview image attribute.

Note: please remove “(whitespace)”

Preview:

video-shortcode-preview

HTML Code the shortcode output:
<video class="wp-video-shortcode" id="video-3325-1" width="604" height="640" poster="https://www.google.com/images/srpr/logo4w.png" controls="controls" preload="none"><source type="video/mp4" src="http://www.test.com/test.mp4"><a href="http://www.test.com/test.mp4">http://www.test.com/test.mp4</a></video>

Apparently, it’s using HTML5.

As for the audio shortcode, it only supports src attribute.

Share and Enjoy

    FacebookTwitterGoogle PlusLinkedInStumbleUponPinterestRedditTumblrDiggEmailPrint

Related Posts