Home › Forums › Calendar Products › Events Calendar PRO › labels
- This topic has 4 replies, 2 voices, and was last updated 10 years, 7 months ago by
George.
-
AuthorPosts
-
September 13, 2015 at 2:26 am #1004639
John Paul
ParticipantHi.. I have used the guidelines to re label certain words using the following
function tribe_custom_theme_text ( $translations, $text, $domain ) {
$custom_text = array(
‘Photo’ => ‘Grid’,
‘Month’ => ‘Calendar’,
‘Events’ => ‘Courses’,
‘Find events’ => ‘Find courses’,
);
if(strpos($domain, ‘tribe-‘) === 0 && array_key_exists($text, $custom_text) ) {
$text = $custom_text[$text];
}
return $text;
}
add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);However, 2 things I need to fix 1) the Find events to Find courses wont work and I have tried this version and all upper case and all lower case.
2) In the “view as” I have successfully changed ‘Photo’ to ‘Grid’ but ‘Month’ won’t change to ‘Calendar’
best
September 13, 2015 at 3:13 pm #1004699John Paul
ParticipantHi.. I have just realised that this was working fine before the upgrade…
did anything get changed that in the gettext commands for Month and Events labels?
September 14, 2015 at 7:23 am #1004820George
ParticipantHey John,
Sorry you’re having trouble here! I think I can help by first addressing your questions about whether anything was changed in our recent update that could affect this.
The answer is yes, because WordPress.org itself required all plugins recently to update their text domains to match the plugin. Ours previously was ‘tribe-events-calendar’, but our recent update set this to the now-correct ‘the-events-calendar’. Small difference, but it will affect the code you posted here. Try updating your code to this instead:
function tribe_custom_theme_text ( $translations, $text, $domain ) {$custom_text = array(
'Photo' => 'Grid',
'Month' => 'Calendar'
);if ( ( 'the-events-calendar' == $domain || 'tribe-events-calendar-pro' == $domain ) && array_key_exists( $text, $custom_text ) ) {
$text = $custom_text[ $text ];
}return $text;
}add_filter( 'gettext', 'tribe_custom_theme_text', 20, 3 );
You’ll notice that Events and “find Courses” are removed from that, which is intentional, because we have a new filter for doing that specifically that you should use in addition to the code above. Here’s an article about this new snippet β https://theeventscalendar.com/knowledgebase/changing-the-word-events-to-something-else/
Try out both things here and let me know if they help! π
β George
September 14, 2015 at 8:00 am #1004844John Paul
ParticipantYou are a Gentleman and a Scholar my friend !
thank you so much
best regards
September 14, 2015 at 5:50 pm #1005102George
ParticipantHa! Likewise John π
I hope your reply means that my suggestions were useful here β I’ll assume that’s the case, and go ahead and close up this thread.
Thanks for the kind words and the fun reply John. Best of luck with your site βΒ and if any other issues arise, we’ll be here to help any time you open a new thread.
Cheers,
George -
AuthorPosts
- The topic ‘labels’ is closed to new replies.
