diff --git src/wp-includes/js/mediaelement/mediaelement-migrate.js src/wp-includes/js/mediaelement/mediaelement-migrate.js
index c2dbd534d9..bb6f809434 100644
|
|
|
22 | 22 | mejs.Utility = mejs.Utils; |
23 | 23 | } |
24 | 24 | |
| 25 | /* |
| 26 | * Remove validation check for language format added in MEJS 3.0.0. |
| 27 | * |
| 28 | * @see https://core.trac.wordpress.org/ticket/42574 |
| 29 | */ |
| 30 | mejs.i18n.language = function () { |
| 31 | var i18n = mejs.i18n; |
| 32 | |
| 33 | for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { |
| 34 | args[_key] = arguments[_key]; |
| 35 | } |
| 36 | |
| 37 | if (args !== null && args !== undefined && args.length) { |
| 38 | |
| 39 | if (typeof args[0] !== 'string') { |
| 40 | throw new TypeError('Language code must be a string value'); |
| 41 | } |
| 42 | |
| 43 | i18n.lang = args[0]; |
| 44 | |
| 45 | if (i18n[args[0]] === undefined) { |
| 46 | // Load passed strings or fall back to the defaults. |
| 47 | args[1] = args[1] !== null && args[1] !== undefined && typeof(args[1]) === 'object' ? args[1] : {}; |
| 48 | i18n[args[0]] = $.isEmptyObject(args[1]) ? i18n.en : args[1]; |
| 49 | } else if (args[1] !== null && args[1] !== undefined && typeof(args[1]) === 'object') { |
| 50 | i18n[args[0]] = args[1]; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | return i18n.lang; |
| 55 | }; |
| 56 | |
| 57 | // Manually load WP i18n strings after MEJS is initialized. |
| 58 | if (typeof mejsL10n !== 'undefined') { |
| 59 | mejs.i18n.language(mejsL10n.language, mejsL10n.strings); |
| 60 | } |
| 61 | |
25 | 62 | /** |
26 | 63 | * Create missing variables and have default `classPrefix` overridden to avoid issues. |
27 | 64 | * |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index cc401f6925..1fbbe3b840 100644
|
|
function wp_default_scripts( &$scripts ) { |
356 | 356 | $scripts->add( 'mediaelement-core', "/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js", array(), '4.2.6-78496d1', 1 ); |
357 | 357 | $scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js", array(), false, 1); |
358 | 358 | |
359 | | did_action( 'init' ) && $scripts->add_inline_script( 'mediaelement-core', sprintf( 'var mejsL10n = %s;', wp_json_encode( array( |
| 359 | did_action( 'init' ) && $scripts->add_inline_script( 'mediaelement-migrate', sprintf( 'var mejsL10n = %s;', wp_json_encode( array( |
360 | 360 | 'language' => strtolower( str_replace( '_', '-', is_admin() ? get_user_locale() : get_locale() ) ), |
361 | 361 | 'strings' => array( |
362 | 362 | 'mejs.install-flash' => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ), |
… |
… |
function wp_default_scripts( &$scripts ) { |
446 | 446 | ), |
447 | 447 | ) ) ), 'before' ); |
448 | 448 | |
449 | | |
450 | 449 | $scripts->add( 'mediaelement-vimeo', "/wp-includes/js/mediaelement/renderers/vimeo.min.js", array('mediaelement'), '4.2.6-78496d1', 1 ); |
451 | 450 | $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement$suffix.js", array('mediaelement'), false, 1 ); |
452 | 451 | $mejs_settings = array( |