Support

Home Forums Wait List Manager Add-on Wait List Custom Message

Wait List Custom Message

Posted: October 31, 2018 at 12:04 pm


Jonathan

October 31, 2018 at 12:04 pm

How do I change the text in the wait list pop up:

“If you would like to be added to the wait list for this event, then please enter your name and email address, and we will contact you when spaces become available.”

I need to add another sentence. Please advise.
Thanks


Josh

  • Support Staff

October 31, 2018 at 12:23 pm

Hi,

The documentation has some example code that you can adapt:

https://eventespresso.com/wiki/wait-list-manager/#change_text_strings


Jonathan

October 31, 2018 at 12:27 pm

brilliant.. thanks


Jonathan

October 31, 2018 at 12:36 pm

I tried adding this to my function file but it didn’t change the text..

//* Waitlist custom message
function my_waitlist_filter_gettext( $translated, $original, $domain ) {
    
    if( $domain == 'event_espresso' ) {    
        // This is an array of original strings
        // and what they should be replaced with
        $strings = array(
            'XXSign Up For The Wait List' => 'Join the Wait list', // button text
            'XXJoin Now' => 'Wait List Form', // main heading
            'XXIf you would like to be added to the wait list for this event, then please enter your name and email address, and we will contact you when spaces become available.XX' 
                => 'Please enter your information and we\'ll be in touch.',
            'Preferred Option' => 'Preference', // field label
            'Join The Wait List' => 'Sign me up', // submit button text
            // 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', 'my_waitlist_filter_gettext', 10, 3 );

any ideas why not?


Josh

  • Support Staff

October 31, 2018 at 1:03 pm

It’s because the first string in each array item must match the original string.

e.g. XXSign Up For The Wait List is not the original string.
Sign Up For The Wait List is the original string.

The support post ‘Wait List Custom Message’ 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