Make WordPress Core

Ticket #40144: 40144.2.diff

File 40144.2.diff, 2.2 KB (added by rudlinkon, 4 years ago)

Refreshed patch UTF-8 encoded

  • .env

     
    1212LOCAL_PORT=8889
    1313
    1414# Where to run WordPress from. Valid options are 'src' and 'build'.
    15 LOCAL_DIR=src
     15LOCAL_DIR=build
    1616
    1717# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
    1818LOCAL_PHP=latest
  • src/js/_enqueues/vendor/mediaelement/wp-mediaelement.js

     
    1919                 * @return {void}
    2020                 */
    2121                function initialize() {
     22                        var selectors = [];
     23
    2224                        if ( typeof _wpmejsSettings !== 'undefined' ) {
    2325                                settings = $.extend( true, {}, _wpmejsSettings );
    2426                        }
     
    6365                                }
    6466                        };
    6567
     68                        if ( 'undefined' === typeof settings.videoShortcodeLibrary || 'mediaelement' === settings.videoShortcodeLibrary ) {
     69                                selectors.push( '.wp-video-shortcode' );
     70                        }
     71                        if ( 'undefined' === typeof settings.audioShortcodeLibrary || 'mediaelement' === settings.audioShortcodeLibrary ) {
     72                                selectors.push( '.wp-audio-shortcode' );
     73                        }
     74                        if ( ! selectors.length ) {
     75                                return;
     76                        }
     77
    6678                        // Only initialize new media elements.
    67                         $( '.wp-audio-shortcode, .wp-video-shortcode' )
     79                        $( selectors.join( ', ' ) )
    6880                                .not( '.mejs-container' )
    6981                                .filter(function () {
    7082                                        return ! $( this ).parent().hasClass( 'mejs-mediaelement' );
  • src/wp-includes/script-loader.php

     
    11091109                'pluginPath'  => includes_url( 'js/mediaelement/', 'relative' ),
    11101110                'classPrefix' => 'mejs-',
    11111111                'stretching'  => 'responsive',
     1112                /** This filter is documented in wp-includes/media.php */
     1113                'audioShortcodeLibrary' => apply_filters( 'wp_audio_shortcode_library', 'mediaelement' ),
     1114                /** This filter is documented in wp-includes/media.php */
     1115                'videoShortcodeLibrary' => apply_filters( 'wp_video_shortcode_library', 'mediaelement' ),
    11121116        );
    11131117        did_action( 'init' ) && $scripts->localize(
    11141118                'mediaelement',