diff --git src/wp-includes/js/mediaelement/wp-mediaelement.js src/wp-includes/js/mediaelement/wp-mediaelement.js
index 17f80519a2..fd964d96cf 100644
|
|
|
|
| 19 | 19 | * @since 4.4.0 |
| 20 | 20 | */ |
| 21 | 21 | function initialize() { |
| | 22 | var selectors = []; |
| | 23 | |
| 22 | 24 | if ( typeof _wpmejsSettings !== 'undefined' ) { |
| 23 | 25 | settings = $.extend( true, {}, _wpmejsSettings ); |
| 24 | 26 | } |
| … |
… |
|
| 40 | 42 | } |
| 41 | 43 | }; |
| 42 | 44 | |
| | 45 | if ( 'undefined' === typeof settings.videoShortcodeLibrary || 'mediaelement' === settings.videoShortcodeLibrary ) { |
| | 46 | selectors.push( '.wp-video-shortcode' ); |
| | 47 | } |
| | 48 | if ( 'undefined' === typeof settings.audioShortcodeLibrary || 'mediaelement' === settings.audioShortcodeLibrary ) { |
| | 49 | selectors.push( '.wp-audio-shortcode' ); |
| | 50 | } |
| | 51 | if ( ! selectors.length ) { |
| | 52 | return; |
| | 53 | } |
| | 54 | |
| 43 | 55 | // Only initialize new media elements. |
| 44 | | $( '.wp-audio-shortcode, .wp-video-shortcode' ) |
| | 56 | $( selectors.join( ', ' ) ) |
| 45 | 57 | .not( '.mejs-container' ) |
| 46 | 58 | .filter(function () { |
| 47 | 59 | return ! $( this ).parent().hasClass( '.mejs-mediaelement' ); |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index b2e24d6fed..d2ec07d0c1 100644
|
|
|
function wp_default_scripts( &$scripts ) {
|
| 372 | 372 | ), |
| 373 | 373 | ) ); |
| 374 | 374 | |
| 375 | | |
| 376 | 375 | $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array('mediaelement'), false, 1 ); |
| 377 | 376 | $mejs_settings = array( |
| 378 | 377 | 'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ), |
| | 378 | |
| | 379 | /** This filter is documented in wp-includes/media.php */ |
| | 380 | 'audioShortcodeLibrary' => apply_filters( 'wp_audio_shortcode_library', 'mediaelement' ), |
| | 381 | |
| | 382 | /** This filter is documented in wp-includes/media.php */ |
| | 383 | 'videoShortcodeLibrary' => apply_filters( 'wp_video_shortcode_library', 'mediaelement' ), |
| 379 | 384 | ); |
| 380 | 385 | did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings', |
| 381 | 386 | /** |