Support

Home Forums Event Espresso Premium Get event's category slug

Get event's category slug

Posted: September 6, 2016 at 3:45 pm


yamamDev

September 6, 2016 at 3:45 pm

I saw a few posts about this, but they seem to be using EE3.
https://eventespresso.com/topic/event-category/
https://eventespresso.com/topic/conditional-statements-on-registration_page_display-php/

Is this function still valid/working in EE4? Im getting an error saying im calling an unknown function.

$category_name = espresso_event_category_data($event_id, TRUE);


Josh

  • Support Staff

September 7, 2016 at 6:45 am

Hi there,

Anything from EE3 will generally not work in EE4. Since EE4’s events are custom post types, you can get the event’s category slug with the wp_get_post_terms() function.

https://codex.wordpress.org/Function_Reference/wp_get_post_terms

The support post ‘Get event's category slug’ 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