Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WP #42574: Fix for ME.js and formal languages. https://core.trac.wordpress.org/ticket/42574
<?php
/**
* Plugin name: WP Trac #42574: Fix for formal languages.
* Plugin URI: https://core.trac.wordpress.org/ticket/42574
* Author: Weston Ruter, XWP.
* Author URI: https://weston.ruter.net
*/
function wp_42574_fix_mejs_formal_languages( WP_Scripts $scripts ) {
$scripts->add_inline_script(
'mediaelement-core',
'mejsL10n.language = mejsL10n.language.replace( /^(\w\w+[-_]\w\w).+/, "$1" );',
'before'
);
}
add_action( 'wp_default_scripts', 'wp_42574_fix_mejs_formal_languages', 11 );

Many thanks for your fix!

Thank you very much, Weston!

Thank you!

That helped a lot. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment