Hi,
I am trying to change the text on the checkout page for Attendee Information and Attendee 1 (or %d). I followed the custom function for that as posted in other threads and the Attendee information changed to participant information as I wanted. However Attendee 1 is still Attendee 1. I have that line as:
‘Attendee %d’ => ‘Student %d’,
Full function:
add_filter( ‘gettext’, ‘ee_venue_filter_gettext’, 10, 3 );
function ee_venue_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Venue’ => ‘Rink’,
‘Venue:’ => ‘Rink:’,
‘Venues’ => ‘Rinks’,
‘Venue Website:’ => ‘Rink Website:’,
‘Venue Phone:’ => ‘Rink Phone:’,
‘Attendee Information’ => ‘Participant Information’,
‘Attendee %d’ => ‘Student %d’,
// 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] );
}
That particular string is wrapped in a different translation function, esc_html_x(). So in this case you’d use a different filter hook. Here’s a code example that you can follow:
The support post ‘Change Text on Checkout Page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.