Is ‘preload=”none”‘ a valid parameter in the [audio] shortcode in WordPress 3.6?

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:

Read More


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

Related posts

1 comment

  1. 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.

Comments are closed.