Knowledge Base
How to Change or Translate Text in the Coupon Creator such as Click to Print
The Coupon Creator is translation ready and a complete translation in other language is forth coming, but you can take advantage of WordPress Filters to change the text on your own right now.
Below is coding you can add to your site to your site or you can use a plugin such as Say what?
The following example changes the Coupon Creator Pro’s Counter text and also the Click to Print text.
You can experiment with this coding to add your translations to any of the frontend or backend text produced by the Coupon Creator.
Add the following coding to custom plugin or to your child theme’s function.php:
/** * Coupon Creator Filter Text Change the Counter Text "%d of %d" and "Click to Print" * * @since 2.1 * * @param string $translations Translations for a domain * @param string $text Text to translate * @param string $domain Translation Domain */ add_filter('gettext', 'cctor_filter_plugin_text', 20, 3); function cctor_filter_plugin_text ( $translations, $text, $domain ) { // Put your custom text here in a key => value pair // Example: 'Text you want to change' => 'This is what it will be changed to' // The text you want to change is the key, and it is case-sensitive // The text you want to change it to is the value // You can freely add or remove key => values, but make sure to separate them with a comma // This example changes the label "'%d of %d" to "%d out of %d", and "Click to Print" to "Print the Coupon" $custom_text = array( '%d of %d' => '%d out of %d', 'Click to Print' => 'Print the Coupon', 'Categories' => 'Kategorier', ); // If this text domain starts with "tribe-" or "the-events-", and we have replacement text if((strpos($domain, 'coupon-') === 0 || strpos($domain, 'coupon-creator') === 0) && array_key_exists($text, $custom_text) ) { $text = $custom_text[$text]; } return $text; }