Add query var to full calendar ajax call

WordPress Event Management, Calendars & Registration Forums General Question Add query var to full calendar ajax call

This topic contains 2 replies, has 2 voices, and was last updated by  Stephen Harris 6 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27429

    Is there a way to add a query var to the “/wp-admin/admin-ajax.php?action=eventorganiser-fullcal&start=2017-05-14” call? So, for example, say I’m not this page example.com/calendar?location=3. I want to use the eventorganiser_fullcalendar_query filter to only get events with a location id of 3. But the location=3 is not being sent in the admin-ajax.php call so I have no access to the requesting page’s parameters.

    Brian Reeves
    #27433

    I was able to get this working by using a js hook (below). Is there a better way?

    wp.hooks.addFilter('eventorganiser.fullcalendar_request', function(req) {
        var locationId = getParameterByName('location_id');
        if (locationId) {
            req.location_id = locationId;
        }
        return req;
    }, 10);
    
    Brian Reeves
    #27436

    Hi Brian,

    No, that’s the correct way.

    Stephen Harris
Viewing 3 posts - 1 through 3 (of 3 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.