WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that MediaElement.js is part of the WordPress core in WordPress 3.6. I currently use the MediaElement.js plugin on my WordPress 3.5.1 sites. On some pages, we have several players on one page, and we need to specify preload="none" as a parameter in the MediaElement.js shortcode, because if we don't, some browsers (mainly iOS devices) will try to download all the MP3 files at once.

Here is the shortcode that we currently use:

[audio mp3="filename.mp3" preload="none"]

In WordPress 3.6, with MediaElement.js built-in, will the preload="none" parameter have any effect in the [audio] shortcode?

share|improve this question
Anyone know off the top of their head which file I would look at in the WordPress 3.6 core to see how the [audio] shortcode is processed? – Ben Miller May 30 '13 at 15:00
As of WordPress 3.6-beta3-24375, the shortcode is processed in wp-includes/media.php, function wp_audio_shortcode (line 844). – Ben Miller May 30 '13 at 15:29
up vote 2 down vote accepted

I looked at the wp_audio_shortcode function in wp-includes/media.php of the release version of WordPress 3.6. The preload parameter is a valid attribute of the [audio] shortcode. However, the default is 'none', so in my case it is not needed.

From WordPress 3.6 (release), wp-includes/media.php, function wp_audio_shortcode:

$default_types = wp_get_audio_extensions();
$defaults_atts = array(
    'src'      => '',
    'loop'     => '',
    'autoplay' => '',
    'preload'  => 'none'
foreach ( $default_types as $type )
    $defaults_atts[$type] = '';

$atts = shortcode_atts( $defaults_atts, $attr, 'audio' );

So the answer is, yes, it is a valid parameter in the [audio] shortcode, but the default value is 'none', so in this case it is not needed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.