Get the categorie name of Event Organiser plugin

How can I get the name of a category in a custom template of the Event Organiser Plugin.

So far the only thing I can get it slug of the category by reading the following variable:

echo $eo_event_loop-query['event-category']; // test-cat

From digging a little in standard template the only thing I found is that they use the standard WP function single_cat_title()

echo single_cat_title( '', false );

But it doesn't generates any output in the template.

The template based on the following two global variables:

global $eo_event_loop,$eo_event_loop_args;

From what I can find in function reference of the Event Organiser plugin there is not such a function I'm looking for.

Topic plugin-event-organiser categories Wordpress

Category Web


Okay I found the solution. A view in the mySQL table helped to understand how the Event Organiser plugin is using Wordpress. The Event Categories a just normal categories with the taxonomy event-category. The only function needed is get_term_by().

// Get term by slug ''test-cat'' in event-category taxonomy.
$cat = get_term_by('slug', $eo_event_loop->query['event-category'], 'event-category');
echo $cat->name; // Output: Test Category

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.