Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('tribe_venue_label_singular', 'change_single_venue_label' );
- function change_single_venue_label() {
- return 'Location';
- }
- add_filter('tribe_venue_label_plural', 'change_plural_venue_label' );
- function change_plural_venue_label() {
- return 'Locations';
- }
- add_filter('tribe_organizer_label_singular', 'change_single_organizer_label' );
- function change_single_organizer_label() {
- return 'Hike Leader';
- }
- add_filter('tribe_organizer_label_plural', 'change_plural_organizer_label' );
- function change_plural_organizer_label() {
- return 'Hike Leaders';
- }
- add_filter('tribe_ce_submit_event_page_title', 'change_the_title');
- function change_the_title() {
- return 'Submit a Hike';
- }
- // This example replaces "Event" with "Meeting" in all Tribe Plugins text
- // See the codex to learn more about WP text domains:
- // http://codex.wordpress.org/Translating_WordPress#Localization_Technology
- // Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'...
- add_filter('gettext', 'theme_filter_text', 10, 3);
- function theme_filter_text( $translations, $text, $domain ) {
- // If this text domain starts with "tribe-"
- if(strpos($domain, 'tribe-') === 0) {
- // Replace upper case, lower case, singular, and plural
- $text = str_replace(
- // Text to search for
- array('Event', 'event', 'Events', 'events'),
- // Text to replace it with -- change this for your needs
- array('Hike', 'hike', 'Hikes', 'hikes'),
- $text
- );
- }
- return $text;
- }
- add_filter('ngettext', 'theme_filter_ntext', 10, 5);
- function theme_filter_ntext( $translation, $single, $plural, $number, $domain ) {
- // If this text domain starts with "tribe-"
- if(strpos($domain, 'tribe-') === 0) {
- // Replace upper case, lower case, singular, and plural
- if( $number > 1 ) {
- $plural = str_replace(
- // Text to search for
- array('Events', 'events'),
- // Text to replace it with -- change this for your needs
- array('Hikes', 'hikes'),
- $plural
- );
- return $plural;
- } else {
- $single = str_replace(
- // Text to search for
- array('Event', 'event'),
- // Text to replace it with -- change this for your needs
- array('Hike', 'hike'),
- $single
- );
- return $single;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement