Posted: 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?
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: