SHARE
TWEET

change translatable text programatically

eventsmanager May 26th, 2014 341 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. //Rewrite any gettext field, this works for any translation for any plugin, check the $domain == 'dbem' to be more specific
  3. function my_em_text_rewrites($translation, $orig, $domain) {
  4.         switch ($orig) {
  5.                 case 'Booking is now fully paid and confirmed.' :
  6.                         $translation = 'your text here';
  7.                         break;
  8.                 case 'Repeat this again for what you want to translate (needs to be exactly same text in english)' :
  9.                         $translation = 'your text here';
  10.                         break;
  11.         }
  12.         return $translation;
  13. }
  14. add_action ( 'gettext', 'my_em_text_rewrites', 1, 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