I’m trying to get my “Register Now” buttons to read “Learn More” and I’ve tried using (and it doesn’t work):
function mycustom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
‘Register’ => ‘Sign up’,
‘Register Now’ => ‘Learn More’,
‘Confirm and go to payment page’ => ‘Complete registration’,
‘No events available…’ => ‘No upcoming classes at this time…’,
‘click here to add a new state/province’ => ‘click here to enter address outside US/Canada’,
// 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] );
}
Can you post a link to the page you are trying to change the text on, please?
The above function should work fine for EE4 (it’s using a WordPress hook so doesn’t change across EE versions), I added the above snippet to one of my test sites and its changing the ‘Register Now’ text on the ticket selector to ‘Learn More’ – http://take.ms/28s34
Are you adding the above to a custom functions plugin?/ If so have you confirmed the plugin you are adding it to is active?
The support post ‘Does the 'custom function' on this page, work for EE4, or just EE3?’ 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.