Skip to content

Instantly share code, notes, and snippets.

@vladutilie
Created June 23, 2020 11:12
Show Gist options
  • Save vladutilie/021c46fe7236246b77920e9ea4253717 to your computer and use it in GitHub Desktop.
Save vladutilie/021c46fe7236246b77920e9ea4253717 to your computer and use it in GitHub Desktop.
Replaces Romanian diacritics from entire WordPress installation
add_filter( 'gettext', 'remove_romanian_diacritics' );
function remove_romanian_diacritics( $translation ) {
$diacritics = [ 'ă', 'â', 'î', 'ș', 'ț', 'Ă', 'Â', 'Î', 'Ș', 'Ț' ];
$replace_with = ['a', 'a', 'i', 's', 't', 'A', 'A', 'I', 'S', 'T' ];
$translation = str_replace( $diacritics, $replace_with, $translation );
return $translation;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment