Support

Home Forums Multiple Event Registration Add-on Customizing Button Text – Am I missing something in writing my filters?

Customizing Button Text – Am I missing something in writing my filters?

Posted: April 26, 2017 at 12:31 am

Viewing 3 reply threads


Fastwinn

April 26, 2017 at 12:31 am

Hi, I’m new to EventEspresso. Purchased the Everything license on 4/22. Trying to customize for my client. I have created a custom plug-in for filtering the buttons text. I found the list of needed filters under https://eventespresso.com/wiki/ee4-multiple-event-registration-add-on/#customizations

I can see the sample:
function ee_mer_change_cart_name(){
return ‘cart’;
}

add_filter( ‘FHEE__EED_Multi_Event_Registration__set_definitions__event_cart_name’, ‘ee_mer_change_cart_name’ );

And it works with my client’s website. However, when I attempt to duplicate for the button text, I get a fatal error. Am I writing something incorrectly?

function ee_mer_change_return_to_events_list_btn_txt(){
return ‘Back to Class List’;
}

add filter ( ‘FHEE__EED_Multi_Event_Registration__return_to_events_list_btn_txt’, ‘ee_mer_change_return_to_events_list_btn_txt’ );

The filter ‘FHEE__EED_Multi_Event_Registration__return_to_events_list_btn_txt’ was given in the link above, but I’ve tried as __set_definitions__ and I’ve tried as _display_ and I’ve tried just as I copied it, above.

My client sells art classes, so anything with the word Event in it needs to change to Class, or have the word Event removed. We’re trying to get everything set up and tested before we publish all the events and move the shortcode over.

The site is: https://toscanastudioandgallery.com. I have the EE shortcode on
https://toscanastudioandgallery.com/abstract/

Thanks!


Tony

  • Support Staff

April 26, 2017 at 4:22 am

Hi there,

I can’t view your site as WordFence is blocking my location (I’m from the UK).

However, when I attempt to duplicate for the button text, I get a fatal error. Am I writing something incorrectly?

What fatal error are you getting?

This code you posted:

add filter ( ‘FHEE__EED_Multi_Event_Registration__return_to_events_list_btn_txt’, ‘ee_mer_change_return_to_events_list_btn_txt’ );

Is incorrect and will throw a fatal error because of the add filter ( that should be add_filter(

I have an example of those filters in use here:

https://gist.github.com/Pebblo/385e46712013a3ee5908

As a side note, when posting code its better to create a Gist or use something like PasteBin then post a link here for us to view as the forum adds formatting which makes it much harder to read/spot mistakes.


Fastwinn

April 26, 2017 at 4:21 pm

Hi Tony,
Changing to add_filter fixed it! Thank you also for the link to other examples; it’s much appreciated. I will remember your location and the suggestions if I need to post another ticket. Please mark this one as resolved.
Cheers,
Maureen


Tony

  • Support Staff

April 26, 2017 at 5:26 pm

You’re most welcome, Maureen. I’m glad it is now working for you.

I’ll mark this thread resolved, any further questions please feel free to open up another thread.

Viewing 3 reply threads

The support post ‘Customizing Button Text – Am I missing something in writing my filters?’ 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