But I don’t think I can use get_field(‘event_type’, $registration->event()->ID()) in the mycustom_filter_gettext() function as I don’t know if $registration is available. Or what other reference I can use.
So, the get_text filter isn’t passed the EE_Registration object, but it would be possible to pull it from the request. However, there are other filters on the thank you page that make this a little easier to do.
AHEE__thank_you_page_overview_template__top is fired at the top of the thank you page and that is passed the EE_Transaction object. You can than use that to pull the event from and add a filter onto the thank you text.
That example will change the thank you text to whatever is returned from tw_filter_thank_you_text_based_on_event if the event has a custom value with key change_thank_you which returns a truthy value so should give you an idea of how you can do this.
The support post ‘Change thank you text, but only for certain events’ 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.