Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Get Event Category | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Get Event Category

Get Event Category

Posted: September 4, 2012 at 5:42 pm

Viewing 2 reply threads


mminten

September 4, 2012 at 5:42 pm

I would like to display something on the event registration page only for a specific event category. Is there a code that I can use to pull this data?

For example your code uses this for the venue name:

echo $venue_title != ''?''.stripslashes_deep($venue_title).'':''

How would I do this for Category? Is it something like this:

echo $category != ''?'stripslashes_deep($category)':''


Sidney Harrell

  • Support Staff

September 4, 2012 at 6:11 pm

It looks like the category data is not pulled on the registration page. So you’d have to do something like:

    $sql = "SELECT cd.category_identifier FROM " . EVENTS_CATEGORY_TABLE . " cd JOIN " . EVENTS_CATEGORY_REL_TABLE . " cr ON cr.cat_id = cd.id WHERE cr.event_id = '%s'";
   $results = $wpdb->get_col($wpdb->prepare($sql, $event_id));
   echo  in_array('my_cat_identifier',$results) ? 'My Category Message' : '';

That should work.


mminten

September 6, 2012 at 10:19 am

Perfect, thanks!

Viewing 2 reply threads

The support post ‘Get Event 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.

Event Espresso - Staging Server