Last active
May 8, 2017 10:00
-
-
Save theresavs/614829a9c2d80bd95e6688f6eb675d51 to your computer and use it in GitHub Desktop.
This file contains 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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
function ee_custom_sold_out_messaging( $translated, $original, $domain ) { | |
// This is an array of original strings | |
// and what they should be replaced with | |
$strings = array( | |
'Sold Out' => 'Class full', | |
'Confirm and go to payment page' => 'Complete registration', | |
'No events available...' => 'No upcoming classes at this time...', | |
'Event Date Ticket Uses' => 'Class Admission', | |
'Sale Dates' => 'Registration Dates', | |
'The dates when this option is available for purchase.' => 'Dates when registration is available.', | |
'Goes On Sale:' => 'Start', | |
'Sales End:' => 'Ends', | |
'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to' => 'Date and time this class is scheduled for', | |
// Add some more strings here | |
); | |
// See if the current string is in the $strings array | |
// If so, replace its translation | |
if ( isset( $strings[$original] ) ) { | |
// This accomplishes the same thing as __() | |
// but without running it through the filter again | |
$translations = get_translations_for_domain( $domain ); | |
$translated = $translations->translate( $strings[$original] ); | |
} | |
return $translated; | |
} | |
add_filter( 'gettext', 'ee_custom_sold_out_messaging', 10, 3 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to' => 'Date and time this class is scheduled for',
Should be:
'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s' => 'Date and time this class is scheduled for %1$s%2$sAdmission is always one person per ticket.%3$s'
See: https://eventespresso.com/topic/show-number-of-attendees-for-an-event/#post-240746