Hi there
Great plugin by the way!
Just having a little problem – I’ve managed to change the title from ‘Upcoming Events’ to ‘Forthcoming Concerts’, but i’d really like to change all the labels where ‘events’ appear to concerts. I’ve tried adding in:
add_filter( ‘gettext’, ‘events_to_concerts’ );
function events_to_concerts( $text ) {
return str_replace( ‘events’, ‘concerts’, $text );
}
But it seems to have no effect at all.
My code so far looks like this –
<?php
//************Change title of upcoming concerts**********//
add_filter(‘gettext’, ‘theme_filter_text’, 10, 3);
function theme_filter_text( $translations, $text, $domain ) {
// Copy and modify the following if {} statement to replace multiple blocks of text
// Match the text you want you want to translate, preferably also match the text domain
if($text === ‘Upcoming Events’ && $domain === ‘tribe-events-calendar’) {
// The custom text you want instead
$text = ‘Forthcoming Concerts’;
} elseif($text === ‘Next Events’ && $domain === ‘tribe-events-calendar’) {
$text = ‘Next Concert’; }
elseif($text === ‘Previous Events’ && $domain === ‘tribe-events-calendar’) {
$text = ‘Previous Concert’;}
return $text;
}
add_filter( ‘gettext’, ‘events_to_concerts’ );
function events_to_concerts( $text ) {
return str_replace( ‘events’, ‘concerts’, $text );
}
?>
Any help would be really appriciated!
Many thanks
D