Client is asking about the possibility of somehow better exposing category options on the full calendar view. Is there a way to display a list of category names and something like check-boxes to turn on or off particular categories? Or a way to customize the drop-down menu text “view all categories”?
Clay Showalter
Hi Clay,
Apologies for the delay in getting back to you. This might be possible by not using the category filter and rendering the checkboxes yourself. You can use the WP JS hooks, and there are couple of ways of doing this.
First, you could use the eventorganiser.fullcalendar_render_event
to hide events which don’t match the selected categories (this is what the Pro plug-in does):
wp.hooks.addFilter( 'eventorganiser.fullcalendar_render_event', 'event-organiser/event-organiser-pro/filter-events', function( bool, event, element, view ){
if ( /* event.category doesn't contain any selected categories */ ) {
return false;
}
return bool;
}, 4 );
This is probably the easiest way of doing it, but you will need to write the javascript code to determine which categories are selected.
Alternatively you could use the eventorganiser.fullcalendar_request
to modify the API request. However you would also need to then refresh the calendar whenever the selection changed. I would favour the former approach.
Stephen Harris