Various technical articles, IT-related tutorials, software information, and development journals
Friday, July 17, 2020
The Woocommerce gettext hook receives already-escaped HTML
Today I needed to change the "Billing & Shipping" label on a Woocommerce checkout page. Conveniently there is a gettext hook to which functions can be attached to postprocess the results of translation. This thread has an example, but just adjusting the target text did not work. It turns out that the first $translated_text parameter receives HTML-escaped text, so I actually needed to compare against "Billing & Shipping".
Labels:
misc
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment