diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/js/mediaelement/wp-mediaelement.js --- a/wp/wp-includes/js/mediaelement/wp-mediaelement.js Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/js/mediaelement/wp-mediaelement.js Fri Sep 05 18:40:08 2025 +0200 @@ -19,6 +19,8 @@ * @return {void} */ function initialize() { + var selectors = []; + if ( typeof _wpmejsSettings !== 'undefined' ) { settings = $.extend( true, {}, _wpmejsSettings ); } @@ -63,8 +65,18 @@ } }; + if ( 'undefined' === typeof settings.videoShortcodeLibrary || 'mediaelement' === settings.videoShortcodeLibrary ) { + selectors.push( '.wp-video-shortcode' ); + } + if ( 'undefined' === typeof settings.audioShortcodeLibrary || 'mediaelement' === settings.audioShortcodeLibrary ) { + selectors.push( '.wp-audio-shortcode' ); + } + if ( ! selectors.length ) { + return; + } + // Only initialize new media elements. - $( '.wp-audio-shortcode, .wp-video-shortcode' ) + $( selectors.join( ', ' ) ) .not( '.mejs-container' ) .filter(function () { return ! $( this ).parent().hasClass( 'mejs-mediaelement' );