gettext filter alters html
-
I recently upgraded to 4.1 from 3.something and a filter I had set up to alter some text and replace it with some html, now displays the raw html characters.
I do the following:
add_filter( 'gettext', "my_func", 20, 3 ); function my_func($translated_text, $text, $domain ) { if ($translated_text == "target text") { $translated_text = __("target<br />text"); } return $translated_text }
… and what I see is exactly this:
target<br />text
instead of this
target
textWhen I examine the html, I can see that the angle brackets have been replaced with their
& lt; and & gt;
equivalents.
So what do I have to do if I want to replace text with some HTML?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘gettext filter alters html’ is closed to new replies.