Skip to content

Instantly share code, notes, and snippets.

@ocReaper
Last active April 10, 2020 10:16
Show Gist options
  • Save ocReaper/6ce3662ab720dc9e7820939aa0c1e7b6 to your computer and use it in GitHub Desktop.
Save ocReaper/6ce3662ab720dc9e7820939aa0c1e7b6 to your computer and use it in GitHub Desktop.
WordPress mu-plugin to change the WPML language code in the URL from ja to jp
<?php
/**
* Change the Japanese subdirectory language code from ja to jp
*
* @param array $language_codes_map
*
* @return array
*/
function akos_resch_wpml_subdirectory_language_code_ja_to_jp( $language_codes_map ) {
$language_codes_map['ja'] = 'jp';
return $language_codes_map;
}
add_filter( 'wpml_language_codes_map', 'akos_resch_wpml_subdirectory_language_code_ja_to_jp', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment