Make WordPress Core

Changeset 34311


Ignore:
Timestamp:
09/18/2015 07:59:43 PM (10 years ago)
Author:
wonderboymusic
Message:

Media: add a filter, 'mejs_settings', to allow devs to pass more config settings to MediaElement.

Fixes #33506.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r34233 r34311  
    352352
    353353    $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 );
    354     did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings', array(
     354    $mejs_settings = array(
    355355        'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
    356     ) );
     356    );
     357    did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings',
     358        /**
     359         * Filter the MediaElement configuration settings.
     360         *
     361         * @since 4.4.0
     362         *
     363         * @param array $mejs_settings MediaElement settings array.
     364         */
     365        apply_filters( 'mejs_settings', $mejs_settings )
     366    );
    357367
    358368    $scripts->add( 'froogaloop',  "/wp-includes/js/mediaelement/froogaloop.min.js", array(), '2.0' );
Note: See TracChangeset for help on using the changeset viewer.