Make WordPress Core

Changeset 55271

Timestamp:
02/07/2023 03:57:24 PM (18 months ago)
Author:
joedolson
Message:

Media: Enable selective optout for video and audio shortcodes.

Make the JavaScript selectors for audio and video shortcodes aware of the state of the wp_video_shortcode_library and wp_audio_shortcode_library filters. Allow extenders to replace the library for either media shortcode.

Props westonruter, joedolson, rudlinkon, obayedmamur.
Fixes #40144.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/vendor/mediaelement/wp-mediaelement.js

    r47094 r55271  
    2020         */
    2121        function initialize() {
     22
     23
    2224            if ( typeof _wpmejsSettings !== 'undefined' ) {
    2325                settings = $.extend( true, {}, _wpmejsSettings );
     
    6466            };
    6567
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
    6678            // Only initialize new media elements.
    67             $( '.wp-audio-shortcode, .wp-video-shortcode' )
     79            $( )
    6880                .not( '.mejs-container' )
    6981                .filter(function () {
  • trunk/src/wp-includes/script-loader.php

    r55269 r55271  
    11121112        'classPrefix' => 'mejs-',
    11131113        'stretching'  => 'responsive',
     1114
     1115
     1116
     1117
    11141118    );
    11151119    did_action( 'init' ) && $scripts->localize(
Note: See TracChangeset for help on using the changeset viewer.