Created
February 11, 2020 18:01
-
-
Save jesseeproductions/cd8a1a98c59bd4139187a6582c99ce72 to your computer and use it in GitHub Desktop.
Change the Get Tickets and RSVP Now on List View and Single Events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change the Get Tickets and RSVP Now on List View and Single Events | |
* | |
* @param string $translation The translated text. | |
* @param string $text The text to translate. | |
* @param string $domain The domain slug of the translated text. | |
* @param string $context The option context string. | |
* | |
* @return string The translated text or the custom text. | |
*/ | |
//add_filter( 'gettext', 'tribe_change_get_tickets_and_rsvp_now', 20, 3 ); | |
function tribe_change_get_tickets_and_rsvp_now( $translation, $text, $domain, $context = "" ) { | |
if ( | |
$domain != "default" && | |
( | |
strpos( $domain, 'event-' ) !== 0 | |
) | |
) { | |
return $translation; | |
} | |
$ticket_rsvp_text = array( | |
// RSVP Now List View | |
'%s Now' => 'Register Now!', | |
// Confirm RSVP Form - Single Views | |
'Confirm %s' => 'Register Now!', | |
// Get Tickets on List View | |
'Get %s' => 'Register Now!', | |
// Get Tickets Form - Single View | |
'Get Tickets' => 'Register Now!', | |
); | |
// If we don't have replacement text, bail. | |
if ( empty( $ticket_rsvp_text[ $text ] ) ) { | |
return $translation; | |
} | |
return $ticket_rsvp_text[ $text ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment