Is there a way to change the category dropdown for the search or Calendar filter to checkboxes so we can select multiple categories?
Please let me know how it’s possible.
Thanks

Mehrdad Emami
It can be done with the calendar with the following JavaScript:
jQuery( 'document' ).ready(function($){
if ($(".eo-fullcalendar").length > 0) {
var terms = eventorganiser.fullcal.categories;
var term, html = "<ul class='eo-cal-checkboxes'>";
for ( var term_id in terms ){
term = terms[term_id];
html = html + "<li><input type='checkbox' checked=checked value='"+term.slug+"'>"+term.name+"</li>";
}
var html = html + "</ul>";
$( '.eo-fullcalendar' ).each( function(){
$(this).append( html );
});
$( '.eo-cal-checkboxes' ).on( 'click', function(){
$(".eo-fullcalendar").fullCalendar("rerenderEvents");
});
wp.hooks.addFilter( 'eventorganiser.fullcalendar_render_event', function( render, event, eventView, inst ){
var selected = $(inst.calendar.options.id).find(".eo-cal-checkboxes input:checkbox:checked").map(function(){
return $(this).val();
}).get();
var intersect = $.map( event.category, function( event_cat ){
return $.inArray( event_cat, selected ) < 0 ? null : event_cat;
});
return ( intersect.length > 0 );
} );
}
});
You can either add that to the bottom of frontend.js
(and frontend.min.js
) – but keep in mind that changes made to plug-ins are lost when you update that plug-in. Alternatively you could load that javascript from a separate file.

Stephen Harris
Alright, I tried the code and it successfully added the category check boxes but they appear after the calendar. I need them on top.
Most importantly the category filtering had stopped working on my calendar even before I switched to checkboxes.
So can you help me figure out why the category filtration doesn’t work by default?
Thanks

Mehrdad Emami
Just sent you an e-mail regarding this.

Stephen Harris
hm. I got your message about the other one but not this one I think.

Mehrdad Emami
Hi. I’d like to add the checkboxes, too. Is the code/solution above still valid? Thank you.

Brian O’Neill
Hi Brian,
Yes it is – although it doesn’t handle events without a category (i.e., such events do not appear).

Stephen Harris