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
September 4, 2012 at 6:11 pm
Add New Note to this Reply
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
Add New Note to this Reply
Perfect, thanks!