Control Translations


This hook provides you the possibility to filter all translations before creating a translation string out of it. This enables you to a much more performance optimized and cleaner website, as well as for less database entries. The cool part about this hook is the possibility to filer also against different tags. This means you can decide if you want to create translations just for frontend strings or also for backend strings or log strings ans so on. We have everything for your needs ?

Parameter Type Description
$this->activate_translations bool Translations are inactive by default.
$string string The string that should be translated.
$cname string An identificator for specific strings. Use this to determine which strings you want to translate and/or which not.

* Filter to control the translation and optimize
* them to a specific output
$trigger = apply_filters( 'wpwhpro/helpers/control_translations', $this->activate_translations, $string, $cname );

Updated on August 10, 2019

Was this article helpful?

Related Articles