Last active
January 13, 2020 23:51
-
-
Save xniro/97b2ce296e4342335fbe547109887490 to your computer and use it in GitHub Desktop.
Change Text to Anything
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
<?php | |
/** | |
* Changes the label "Tickets" to "Anything You Want". | |
*/ | |
add_filter( 'gettext', 'tribe_change_tickets_text', 20, 3 ); | |
function tribe_change_tickets_text( $translation, $custom_text, $domain ) { | |
$custom_text = array( | |
'Tickets' => 'Anything You Want', | |
); | |
if ( ( strpos( $domain, 'tribe-' ) === 0 || strpos( $domain, 'the-events-' ) === 0 || strpos( $domain, 'event-' ) === 0 ) && array_key_exists( $translation, $custom_text ) ) { | |
$translation = $custom_text[ $translation ]; | |
} | |
return $translation; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment