I’m using the snippet on the link below to send the eventdate to Mailchimp. How would I be able to filter the snippet so it only runs for a selected category within EE4?
To explain, I run both courses and social events and I have a category for each in EE4. So if I want a snippet to only run when a course is booked, how could I do that?
One option for this is to add something like this:
$term_obj_list = get_the_terms( $EVT_ID, 'espresso_event_categories' );
$terms_array = wp_list_pluck($term_obj_list, 'name');
if( ! in_array( 'courses', $terms_array ) ) {
//This event NOT set to be within the course category.
return $subscribe_args;
}
Add that snippet on line 8 of that snippet.
Viewing 1 reply thread
The support post ‘Making the Mailchimp eventdate code snippet filter 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.
Support forum for Event Espresso 3 and Event Espresso 4.