Support

Home Forums Event Espresso Premium Restrict ESPRESSO_MY_EVENTS output by category?

Restrict ESPRESSO_MY_EVENTS output by category?

Posted: February 9, 2019 at 4:43 pm

Viewing 1 reply thread


mdeyerinkc

February 9, 2019 at 4:43 pm

I have a new need to restrict the output of the ESPRESSO_MY_EVENTS table to display just events with a specific category. I have two calendars set up on my site (the main one that displays all events – minus one category type that I’ve filtered out), and the secondary calendar that only displays events from that one category. To mirror that, I’d like to set up a “Your [Category Restricted/Specific] Events” page that only shows the events the subscriber has registered for from that one specific category.

Since the event_category_id= parameter doesn’t appear to work for the espresso_my_events shortcode, is there any way to achieve the same effect with PHP code?


Tony

  • Support Staff

February 15, 2019 at 9:18 am

Hi there,

Currently, you can’t filter the query used to pull in the details for the WP user integration add-on, however, you can create your own custom template and within that overwrite the current objects the shortcode has pulled in and replace them with your own.

It’s a little inefficient as its double the queries, once for the default events which will be ignored and then again for the ‘correct’ events from within your template but should work unless you have high numbers of registrations on a single user?

How comfortable with PHP are you?

Note that before moving forward, you’ll need a child theme, you’ll need to create one if you aren’t using one already:

https://developer.wordpress.org/themes/advanced-topics/child-themes/

Viewing 1 reply thread

The support post ‘Restrict ESPRESSO_MY_EVENTS output by category?’ 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