Created
April 16, 2018 18:27
-
-
Save estevecastells/ff2355f4c1d856663fe75a52ffbdd3df to your computer and use it in GitHub Desktop.
Translate a string via PHP (WordPress)
This file contains 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
//Translate string via PHP | |
add_filter('gettext', 'translate_reply'); | |
add_filter('ngettext', 'translate_reply'); | |
function translate_reply($translated) { | |
$translated = str_ireplace('String you don't like', 'String you want to have', $translated); | |
return $translated; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment