Support

Home Forums Events Calendar Add-on "Add more attendees" button text change, EE3

"Add more attendees" button text change, EE3

Posted: January 26, 2015 at 11:02 am


Brett McCumber

January 26, 2015 at 11:02 am

Hi there,

I want to change text on “Add more attendees?..” button and it’s just not working out for me. I tried to use gettext filter and it didn’t work. I also searched through the forum and nothing. Please let me know how to achieve this.

Thank you.


Tony

  • Support Staff

January 26, 2015 at 11:54 am

Hi Kat,

The string you need to translate is:

‘Add More Attendees? (click to toggle, limit %s)’

The %s is is a place-holder for the attendee limit.

To translate the string you can use either of the two methods mentioned here:

https://eventespresso.com/wiki/how-to-change-wording-with-poedit/


Brett McCumber

January 26, 2015 at 12:25 pm

Hi Tony,

Thank you for the quick reply. I tried that and it did not work. Is there anything else I could try?


Lorenzo Orlando Caum

  • Support Staff

January 26, 2015 at 1:13 pm

Hi Kat,

Which method did you try?

Try this sample coding:

//* Change the add more attendees messaging in Event Espresso 3
function ee_change_add_more_attendees_click_to_toggle_messaging( $translated, $original, $domain ) {
 
    $strings = array(
        'Add More Attendees? (click to toggle, limit %s)' => 'New messaging goes here',
    );

    if ( isset( $strings[$original] ) ) {
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'ee_change_add_more_attendees_click_to_toggle_messaging', 10, 3 );

It can be added to your child theme’s functions.php file (do not include the opening php tag) or a site specific plugin:

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

Be sure to change “New messaging goes here” to something else that you prefer.

Thanks


Lorenzo


Tony

  • Support Staff

January 26, 2015 at 1:13 pm

Which method are you currently using?

I’ve just added this string to Quick Localization and translated it to ‘Testing Another String’ which worked as expected – http://take.ms/okP4u


Brett McCumber

January 26, 2015 at 1:21 pm

Thank you Lorenzo. That worked. I tried that function before but I must’ve made an error somewhere so it didn’t translate for me.


Lorenzo Orlando Caum

  • Support Staff

January 26, 2015 at 1:37 pm

Thanks Kat. There may have been an extra space (e.g. before or after the phrase).

The gettext filter needs an exact match including spacing to run correctly.

If you need help with anything else, just create a new support post in our support forums:

https://eventespresso.com/support/forums/

Thanks and have a great week!


Lorenzo

The support post ‘"Add more attendees" button text change, 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.

Event Espresso