How to change strings like "Click to Print" or rename "Coupon" using the WordPress gettext filter and the plugin's label filters.
Coupon Creator's text domain is coupon-creator. Every user-facing string passes through __() / esc_html__() with that domain, so you can override any of them without editing the plugin.
Change a single string #
Use the core gettext filter, matching on the original English text and the domain:
add_filter( 'gettext', function ( $translated, $original, $domain ) {
if ( 'coupon-creator' !== $domain ) {
return $translated;
}
if ( 'Click to Print' === $original ) {
return 'Print this coupon';
}
return $translated;
}, 10, 3 );
Some strings you may want to target:
| Original | Where it appears |
|---|---|
Click to Print |
Print button in the print view |
Click to Open in Print View |
Link under a coupon in the shortcode view |
Expires on: |
Expiration line |
Rename "Coupon" / "Coupons" #
The post-type labels are filtered separately, so the admin menu, category labels, and template output all update consistently. Return your own label from these filters:
add_filter( 'cctor_coupon_label_singular', fn() => 'Deal' );
add_filter( 'cctor_coupon_label_plural', fn() => 'Deals' );
Companion filters: cctor_coupon_label_singular_lowercase, cctor_coupon_label_plural_lowercase, and the category equivalents cctor_coupon_category_label_singular, cctor_coupon_category_plural, plus their lowercase variants.
Full translations #
The plugin is translation-ready with the coupon-creator text domain, so standard .po/.mo files (or a translation plugin) work as usual. The block editor also receives the loaded translations via inline locale data, so translated strings show in the editor too.