Advertisement
Guest User

hikeitbaby

a guest
Oct 22nd, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. add_filter('tribe_venue_label_singular', 'change_single_venue_label' );
  2. function change_single_venue_label() {
  3. return 'Location';
  4. }
  5.  
  6. add_filter('tribe_venue_label_plural', 'change_plural_venue_label' );
  7. function change_plural_venue_label() {
  8. return 'Locations';
  9. }
  10.  
  11. add_filter('tribe_organizer_label_singular', 'change_single_organizer_label' );
  12. function change_single_organizer_label() {
  13. return 'Hike Leader';
  14. }
  15.  
  16. add_filter('tribe_organizer_label_plural', 'change_plural_organizer_label' );
  17. function change_plural_organizer_label() {
  18. return 'Hike Leaders';
  19. }
  20.  
  21.  
  22. add_filter('tribe_ce_submit_event_page_title', 'change_the_title');
  23. function change_the_title() {
  24. return 'Submit a Hike';
  25. }
  26.  
  27. // This example replaces "Event" with "Meeting" in all Tribe Plugins text
  28.  
  29. // See the codex to learn more about WP text domains:
  30. // http://codex.wordpress.org/Translating_WordPress#Localization_Technology
  31. // Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
  32.  
  33. add_filter('gettext', 'theme_filter_text', 10, 3);
  34.  
  35. function theme_filter_text( $translations, $text, $domain ) {
  36. // If this text domain starts with "tribe-"
  37. if(strpos($domain, 'tribe-') === 0) {
  38. // Replace upper case, lower case, singular, and plural
  39. $text = str_replace(
  40. // Text to search for
  41. array('Event', 'event', 'Events', 'events'),
  42.  
  43. // Text to replace it with -- change this for your needs
  44. array('Hike', 'hike', 'Hikes', 'hikes'),
  45. $text
  46. );
  47.  
  48. }
  49.  
  50. return $text;
  51. }
  52.  
  53. add_filter('ngettext', 'theme_filter_ntext', 10, 5);
  54.  
  55. function theme_filter_ntext( $translation, $single, $plural, $number, $domain ) {
  56. // If this text domain starts with "tribe-"
  57. if(strpos($domain, 'tribe-') === 0) {
  58. // Replace upper case, lower case, singular, and plural
  59. if( $number > 1 ) {
  60. $plural = str_replace(
  61. // Text to search for
  62. array('Events', 'events'),
  63.  
  64. // Text to replace it with -- change this for your needs
  65. array('Hikes', 'hikes'),
  66. $plural
  67. );
  68.  
  69. return $plural;
  70. } else {
  71. $single = str_replace(
  72. // Text to search for
  73. array('Event', 'event'),
  74.  
  75. // Text to replace it with -- change this for your needs
  76. array('Hike', 'hike'),
  77. $single
  78. );
  79.  
  80. return $single;
  81. }
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement