ulf18273
Forum Replies Created
-
Thanks,
Your suggestion to setup my own search method using the em_events_get_default_search filter is hardly a workaround but not a solution.
According to page https://wp-events-plugin.com/tutorials/using-additional-custom-taxonomies/
post_category and post_tag both should work when using it in the event_list shortcode or in the EM_Events->output method. And it works for the post_tag parameter, but not for the post_category parameter because of the way how eventmanager finds the taxonomy using the value in field query_var.
Thanks,
UlfTo answer my own question, why it does not work: it seems like a bug.
The reason is in method
$taxonomies = EM_Object::get_taxonomies() which is being called by
EM_Events::build_sql_conditions() which is called from EM_Events::get()EM_Object::get_taxonomies() returns:
[23-Jan-2016 00:11:52 UTC] ( [category] => Array ( [name] => event-categories [slug] => events/categories [ms] => event-category [context] => Array ( ) [query_var] => event-categories ) [tag] => Array ( [name] => event-tags [slug] => events/tags [context] => Array ( ) [query_var] => event-tags ) [post_category] => Array ( [name] => category [context] => Array ( [0] => event ) [slug] => category <strong>[query_var] => category_name</strong> ) [post_tag] => Array ( [name] => post_tag [context] => Array ( [0] => location ) [slug] => tag [query_var] => tag ) )
and the query for the term is using
$term = get_term_by(‘slug’, $tax_id_clean, $tax_data[‘query_var’]);
The reason why for the post_category element the query_var param is category_name, is because it is definition of the Category taxonomy inside WordPress.
So either WordPress has a bug (which I do not believe) or the event manager should handle the get_term_by call differently.Any insight?
I forgot to mention that if I add the parameter post_category as shown above the result is the “No Events” text.