Hey Robert,
I’m sorry, but that code is from 2013 and is no longer valid code at all. It cannot be used with the current versions of our plugins, and since we cannot support non-current versions of our plugins, that code cannot be used successfully.
I’m surprised it worked at all, and only failed in AJAX requests!
If you want to keep events of a specific category hidden from your calendar, your best bet is just to write some custom CSS. Add code like this to the bottom of your theme’s style.css file:
.type-tribe_events.tribe-events-category-barbecue {
display: none !important;
}
That’s for events in the category “Barbecue.” You can tweak that name to whichever category you need to add, and if there are multiple categories, just add multiple blocks of code like that above; one for each category.
Best of luck with your customizations!
George