Created
February 18, 2020 13:33
-
-
Save jesseeproductions/78eadedda47ef18b8cacbfa8ce4ff9e8 to your computer and use it in GitHub Desktop.
Change Are No Longer Available Message
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 Are No Longer Available Message | |
* | |
* @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_available_msg', 20, 3 ); | |
function tribe_change_available_msg( $translation, $text, $domain, $context = "" ) { | |
if ( | |
$domain != "default" && | |
( | |
strpos( $domain, 'event-' ) !== 0 | |
) | |
) { | |
return $translation; | |
} | |
$ticket_text = array( | |
'%s are no longer available.' => '%s is no longer available.', | |
); | |
// If we don't have replacement text, bail. | |
if ( empty( $ticket_text[ $text ] ) ) { | |
return $translation; | |
} | |
return $ticket_text[ $text ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment