Looking for alternate ways of category filtering/selecting

WordPress Event Management, Calendars & Registration Forums General Question Looking for alternate ways of category filtering/selecting

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 2 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44018

    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
    #44055

    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
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.