Hi Dean
Thank you for that.
I would now like to use the ‘Unique Category Identifiers’ as class names in my espresso_table so that I can filter the list by using checkboxes instead of the category name. This is what I have at the moment in espresso_table.php <tr class="espresso-table-row <?php echo do_shortcode('[CATEGORY_NAME event_id="'.$event->id.'"]');?>">
How do I query the table and return the correct categories for each event in-place of the shortcode?
This is what I have so far.
<code>$sql = "SELECT category_identifier FROM " . EVENTS_CATEGORY_TABLE;
$categoryarray = $wpdb->get_results($sql);
foreach ($categoryarray as $option) {
echo $option->category_identifier;
}</code>
If you are looking for a table with a category filter, you may want to hang fire, as we are going to release (hopefully very soon) an add on that has a table that the the user can filter by categories. (This may be a separate purchase or part of a licence nothing has been decided on that so please be aware it may cost). sneak peak – http://d.pr/i/Uatn
However if you are just wanting to manually filter the list, you could query the $event array. Each $event array contains the category ID’s associated with that event. Then you would need to either query the database to pull the category name via the ID or just continue using the shortcode as that works well and is simple enough.
Viewing 3 reply threads
The support post ‘Ouput all category names’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.