Is there some way to filter Events+ events coming from the network?

This is the overview of the setup.

1. Company HQ (main)
2. Location 1 (subdomain multisite)
3. Location 2 (subdomain multisite)

Admins enter all events at the HQ level (site 1) but each location only would like to show their location specific events. Using both a combination of network="1" and categories="id, id, id" doesn't seem to work in filtering.

Is there any way to filter out the network events that are not part of a specific category?

Any input is of course welcome

Thanks in advance,

Thomas

    Rupok

    Hi Thomas

    Hope you had a wonderful day.

    Using both a combination of network="1" and categories="id, id, id" doesn't seem to work in filtering

    "network" parameter takes only "yes" or "no" as value. Can you try [eab_archive network="yes"] ? It should work.

    Is there any way to filter out the network events that are not part of a specific category?

    I don't think there is any other way of easy filtering. But I think, you can use categories for your subsites. Can you try putting events in different categories according to location? For example, I've created two Event Categories in my test site "California" and "Florida". Added some events in both categories. Now when I use the following shortcode, it only shows events from California. 73 is my category ID for "California" category, please use your respective category ID.
    [eab_archive category="73"]

    Can you please let us know the result? We will be glad to assist further if required.

    Have a nice day. Cheers!

    Thomas

    Hi Rupok,

    Thank you, that is much appreciated!

    I realized I may have neglected to be detailed regarding the current setup. This is the current state of the setup:

    - I'm using the eab_calendar shortcode
    - Categories are setup for each location
    - Each event is tagged with a category for each location
    - Sub-sites are pulling in the event from the network into the calendar with either the yes/no or 1/0 flag
    - Full shortcode looks like this:
    [eab_calendar network="1" navigation="1" category="10"]

    While it's showing all of the events from the network, which are coming from mostly the main site, when I try and display this calendar on any of the sub-sites it displays either all network events or none.

    Setting the category/categories variable does not seem to have an effect while pulling events from the network. Now if I do this on the site that the events originate from, filtering works perfectly, but not in the sub-sites.

    The goal is to have one place where events are entered and stored, and have each location tagged, then have the sub-sites (i.e. individual locations) show only their respective events.

    I hope that I'm expressing the goal of what I'm trying too accomplish well enough.

    Again, the help is awesome and thank you so much for taking the time to do so.

    Have a great day!

    Thomas

    Kasia Swiderska

    Hello Thomas,

    Setting the category/categories variable does not seem to have an effect while pulling events from the network. Now if I do this on the site that the events originate from, filtering works perfectly, but not in the sub-sites.

    I've set my Multisite and get similar results. My suspicion is that category parameter combined with network parameter is ignored - however I have to confirm if this is done by desing or this is actual bug.
    I will ping developer about that and I will also move your thread to support forum.

    kind regards,
    Kasia

    Ash

    Hello Thomas

    I hope you are doing good.

    This is not possible to filter using category when you fetch events for entire network. Currently you can customize the plugin and to achieve this. Please go to /wp-content/plugins/events-and-bookings/lib/class_eab_network.php line no 63 and put the following:

    if( ! has_term( array( 88, 3 ), 'eab_events_category', $event->$pi_post_id ) ) {
                                continue;
                            }

    Here 88, 3 are the category IDs from my test site, please replace with your IDs. Please follow the screenshot.

    Please note that, this changes will be lost in next update. So it's worth to note down this changes somewhere and apply again after your updates.

    Hope it helps Please feel free to ask more question if you have any.

    Cheers
    Ash

    Thomas

    Hi Ash,

    Side remark, for some reason restore_current_blog() function is not triggering. This results in the sub-site pulling data from both the main site and it's own tables.

    So instead of:
    if( ! has_term( array( ID, ID ), 'eab_events_category', $event->$pi_post_id ) ) { continue;}

    I moved it more down to the section with:
    $result[] = $post;

    Then changed it to:

    if( ! has_term( array( ID, ID ), 'eab_events_category', $event->$pi_post_id ) ) {
    					$result[] = '';
    			}else{
    					$result[] = $post;
    			}

    That seems to keep the switch intact. Not elegant...but enough for the proof of concept. Would definitely appreciate input on a more elegant way, like your original solution.

    Have a great rest of the evening!

    Thomas