How can I replace only specific text using gettext
-
I am using this function to replace Divi with Framework
add_filter('gettext', 'translate_text', 10); add_filter('ngettext', 'translate_text'); function translate_text($translated) { $translated = str_ireplace('Divi', 'Framework', $translated); return $translated; }
It works fine as it replaced all instances of Divi with Framework. Now the problem is it also replaces Divider to Frameworkder
How I can prevent this? I only want Divi to be replaced with my chosen text.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How can I replace only specific text using gettext’ is closed to new replies.