daily pastebin goal
56%
SHARE
TWEET

Translate Text using gettext filter/hook

eventsmanager Apr 12th, 2015 (edited) 825 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Translate Text using gettext filter/hook
  3.  * As for where to paste this : http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  4.  */
  5. function change_coupon_label( $translated_text, $text, $domain ) {
  6.         switch ( $translated_text ) {
  7.             case 'Coupon Code' :
  8.                 $translated_text = 'Promotion Code';
  9.                 break;
  10.         }
  11.     return $translated_text;
  12. }
  13. add_filter( 'gettext', 'change_coupon_label', 20, 3 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top