Home › Forums › Ticket Products › Event Tickets Plus › Replacing the word 'Tickets' into 'Admit Card'
- This topic has 3 replies, 2 voices, and was last updated 8 years, 4 months ago by Josh.
-
AuthorPosts
-
January 6, 2016 at 4:09 pm #1051482NethajiParticipant
Hi Team,
We are an educational institute, so we don’t want to use the words tickets to join our class. So as per the article I replaced ‘Tickets’ as ‘Admit Card’ .
Code below didn’t work, Did I make any mistake?
/*
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
* 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’…
*/
function tribe_custom_theme_text ( $translations, $text, $domain ) {// Put your custom text here in a key => value pair
// Example: ‘Text you want to change’ => ‘This is what it will be changed to’
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key => values, but make sure to separate them with a comma
// This example changes the label “Venue” to “Location”, and “Related Events” to “Similar Events”
$custom_text = array(
‘Tickets’ => ‘Admit Card’,
‘Related %s’ => ‘Similar %s’,
);// If this text domain starts with “tribe-“, and we have replacement text
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);January 7, 2016 at 1:48 pm #1052121JoshParticipantHey!
Thanks for reaching out to us!
Try using the following snippet instead. The above snippet is for the main calendar and has the limitation set for the textdomain “tribe-” when we’ll need “event-” to target the “Tickets” wording.
https://gist.github.com/BeardedGinger/7bd2fd310c28cd9899f6
Let me know if this helps.
Thanks!
January 8, 2016 at 4:24 am #1052341NethajiParticipantAwesome. It worked. Thanks Josh!
January 8, 2016 at 11:53 am #1052771JoshParticipantHey,
No problem! Happy to help.
I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.
Thanks!
-
AuthorPosts
- The topic ‘Replacing the word 'Tickets' into 'Admit Card'’ is closed to new replies.