Support

Home Forums Event Espresso Premium Espresso_my_events shortcode filters

Espresso_my_events shortcode filters

Posted: March 18, 2024 at 5:03 pm


smdawg

March 18, 2024 at 5:03 pm

Is there a way to add a filter to the espresso_my_events shortcode? I’m hoping to add an attribute that will limit the data returned from the shortcode. I would like to have the following attribute values:
All – lists out all of the events where this user has a registration – could be the default value
Next – Lists out the next event for this user – only returns 1 event (would like to have a banner on an account page reminding the users of their next event)
Upcoming – lists all of their upcoming event registrations
Past or Expired – lists their historical registrations

We have some users with a number of registrations and breaking up their list of events would be extremely helpful. And having the ability to show them their next registration would be great to have.

Please let me know if you have any questions or suggestions.


Rio

  • Support Staff

March 19, 2024 at 7:34 am

Is there a way to add a filter to the espresso_my_events shortcode? I’m hoping to add an attribute that will limit the data returned from the shortcode

You can use per_page Check the filters here. There’s some customization you can find there too.
https://eventespresso.com/wiki/wp-user-integration/

For customization needed, you can also check with them.
https://eventespresso.com/developers/event-espresso-pros/

thanks


smdawg

March 21, 2024 at 8:19 am

Thanks for the information, Rio.


Tony

  • Support Staff

March 21, 2024 at 9:08 am

Hi there,

I did some digging into this and whilst it is not possible to pass custom shortcode attributes within the code, there is a filter available that allows you to change the query args via code.

Take a look at the FHEE__Espresso_My_Events__getTemplateObjects__query_args filter.

I have an example of using it here:

https://gist.github.com/Pebblo/334ba1f465a367fe9fd14749b9c8dede

I’ll open a discussion on passing the shortcode attributes to that filter which would then allow custom code to hook in and do more based on the attributes, however, I can’t say if it will be included (there may well be a reason its not already available).

The support post ‘Espresso_my_events shortcode 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