Skip to content

Instantly share code, notes, and snippets.

@westonruter
Last active July 31, 2018 08:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonruter/2ed5d98957c5a6e94c580c47abbb476a to your computer and use it in GitHub Desktop.
Save westonruter/2ed5d98957c5a6e94c580c47abbb476a to your computer and use it in GitHub Desktop.
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 );
@pixelverbieger
Copy link

Many thanks for your fix!

@onthisearth
Copy link

Thank you very much, Weston!

@Marandrew
Copy link

Thank you!

@michaelmaass
Copy link

That helped a lot. Much appreciated!

@techmind86
Copy link

Thanks a lot.. It works perfectly...

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