Support

Home Forums Event Espresso Premium CATEGORY_NAME for EE4

CATEGORY_NAME for EE4

Posted: June 1, 2016 at 8:30 am


luis camargo

June 1, 2016 at 8:30 am

Hello. We had a lot of custom code on EE3 and now we’re upgrading to EE4 on a test server. We have latest wordpres and EE version. I’m trying to add the category name to the Upcoming Events Widget and i’m changing EEW_Upcoming_Events.widget.php as you suggested somewhere in the forums, but i need a way to show the category as a class on every single event beacuse our client uses colors depending on category. On EE3 i had something like “<li class=”<?php echo do_shortcode(“[CATEGORY_NAME event_id=” . $event->id . “]”); ?>”>” but now EE4 doesn’t use CATEGORY_NAME shortcode. How can i add that? I know i have to change around 335 line:
echo ‘<li id=”ee-upcoming-events-widget-li-‘ . $event->ID() . ‘” class=”ee-upcoming-events-widget-li ‘. THIS IS WHERE I NEED MY CATEGORY .'”>’;

Thanks in advance.


Josh

  • Support Staff

June 1, 2016 at 9:49 am

Hi Luis,

sanitize_html_class( $event->first_event_category() );

will get you what you’re looking for.

The support post ‘CATEGORY_NAME for EE4’ 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