Support

Home Forums Event Espresso Premium Changing Event Registration Closed Language

Changing Event Registration Closed Language

Posted: March 3, 2015 at 11:13 am

Viewing 1 reply thread


Sarah Hartman

March 3, 2015 at 11:13 am

I found documentation in the Support Forum detailing how to change the “Registration is Closed” message. All the solutions require programming capabilities beyond our skills.

How do I find out if we have enough money left in our support account to ask the EE team to handle this for us?


Lorenzo Orlando Caum

  • Support Staff

March 3, 2015 at 1:57 pm

Hi, I replied to your support token with a question.

Here are notes for anyone else that may have a question on how to change the messaging.

This is the language string that is used:


Since it is wrapped in a textdomain, then it can be changed by using a gettext filter.

function ee_change_messaging_registration_now_closed( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'We are sorry but registration for this event is now closed.' => 'Although online registration has closed, there may still be openings. Please call us for availability.',
    );
 
    // 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_change_messaging_registration_now_closed', 10, 3 );

That could then be added to a child theme’s functions.php file or a site specific plugin:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Lorenzo

Viewing 1 reply thread

The support post ‘Changing Event Registration Closed Language’ 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.

Event Espresso