Last active
December 28, 2019 08:42
-
-
Save audrasjb/6f442fa595e96e77fa3706e88ea29f28 to your computer and use it in GitHub Desktop.
Replace any translated string in WordPress themes or plugins
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
<?php | |
/* Copy this in your child theme functions.php file */ | |
function jba_change_plugin_translations( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Lire plus' : | |
$translated_text = 'Voir le produit'; | |
break; | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'jba_change_plugin_translations', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment