Advertisement
brook-tribe

Change "Events" to something else

Apr 25th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. // THIS IS NOW A TUTORIAL, LATEST SNIPPET FOUND HERE: https://theeventscalendar.com/knowledgebase/changing-the-word-events-to-something-else/
  2.  
  3. // This example replaces "Event" with "Meeting" in all Tribe Plugins text
  4.  
  5. // See the codex to learn more about WP text domains:
  6. // http://codex.wordpress.org/Translating_WordPress#Localization_Technology
  7. // Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
  8.  
  9. add_filter('gettext', 'theme_filter_text', 10, 3);
  10.  
  11. function theme_filter_text( $translations, $text, $domain ) {
  12.  
  13.     // If this text domain starts with "tribe-"
  14.     if(strpos($domain, 'tribe-') === 0) {
  15.         // Replace both upper and lower case
  16.         $text = str_replace(
  17.             array('Event', 'event'), // Text to search for
  18.             array('Meeting', 'meeting'), // Text to replace it with
  19.             $text
  20.         );
  21.  
  22.     }
  23.  
  24.     return $text;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement