mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
23 lines
592 B
Text
23 lines
592 B
Text
add_filter( 'gettext_with_context', 'tribe_change_get_tickets', 20, 4 );
|
|
function tribe_change_get_tickets( $translation, $text, $context = "" , $domain) {
|
|
|
|
if ( $domain != 'default'
|
|
&& strpos( $domain, 'event-' ) !== 0
|
|
) {
|
|
return $translation;
|
|
}
|
|
|
|
$ticket_text = [
|
|
// 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_text[ $text ] ) ) {
|
|
return $translation;
|
|
}
|
|
|
|
return $ticket_text[ $text ];
|
|
}
|