Created
June 7, 2016 21:35
-
-
Save sjaved87/112cb175a9f303547c0e0186db5594a0 to your computer and use it in GitHub Desktop.
Use below code to change the text on anywhere (restrict it with text domain name) on your WordPress Single Site or Multisite.
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 | |
| add_filter('gettext', 'sjaved_change_text_dynamically', 99, 3); | |
| if(function_exists('sjaved_change_text_dynamically')) : | |
| function sjaved_change_text_dynamically( $translated_text, $untranslated_text, $domain ){ | |
| if($domain == 'YourTextDomain' and $untranslated_text == 'YourText' ){ | |
| $translated_text = 'ReplacedText'; | |
| } | |
| return $translated_text; | |
| } | |
| endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment