Create a gist now

Instantly share code, notes, and snippets.

Embed
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 );
@pixelverbieger

This comment has been minimized.

Show comment
Hide comment
@pixelverbieger

pixelverbieger Nov 23, 2017

Many thanks for your fix!

Many thanks for your fix!

@onthisearth

This comment has been minimized.

Show comment
Hide comment
@onthisearth

onthisearth Nov 25, 2017

Thank you very much, Weston!

Thank you very much, Weston!

@Marandrew

This comment has been minimized.

Show comment
Hide comment
@Marandrew

Marandrew Nov 26, 2017

Thank you!

Thank you!

@michaelmaass

This comment has been minimized.

Show comment
Hide comment
@michaelmaass

michaelmaass Nov 28, 2017

That helped a lot. Much appreciated!

That helped a lot. Much appreciated!

@techmind86

This comment has been minimized.

Show comment
Hide comment
@techmind86

techmind86 Jul 31, 2018

Thanks a lot.. It works perfectly...

Thanks a lot.. It works perfectly...

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