Support

Home Forums Event Espresso Premium Get the Event Category Name and store it in a variable?

Get the Event Category Name and store it in a variable?

Posted: November 12, 2013 at 7:59 pm

Viewing 1 reply thread


gavcaz

    November 12, 2013 at 7:59 pm

    Is there a way to get the event category name (the slug) on the event registration page? I’m trying to build a system that compares the slug of the event category to the value of a custom user meta data. Basically if the users custom data matches the category that person can see the event, otherwise they can not see the event.


    Dean

    • Support Staff

    November 13, 2013 at 12:00 am

    Hi,

    The category isn’t used at that point so you would either need to do an SQL call or perhaps use the [CATEGORY_NAME event_id=1] shortcode in a do_shortcode statement

    <?php echo do_shortcode('[CATEGORY_NAME event_id="'.$event_id.'"]');?>

    Shortcode docs – http://staging.eventespresso.com/wiki/shortcodes-template-variables/#event-category

    Viewing 1 reply thread

    The support post ‘Get the Event Category Name and store it in a variable?’ 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 - Staging Server