Skip to content

Instantly share code, notes, and snippets.

@xniro
Last active January 13, 2020 23:51
Show Gist options
  • Save xniro/97b2ce296e4342335fbe547109887490 to your computer and use it in GitHub Desktop.
Save xniro/97b2ce296e4342335fbe547109887490 to your computer and use it in GitHub Desktop.
Change Text to Anything
<?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