Created
June 23, 2020 11:12
-
-
Save vladutilie/021c46fe7236246b77920e9ea4253717 to your computer and use it in GitHub Desktop.
Replaces Romanian diacritics from entire WordPress installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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