Home › Forums › Calendar Products › Events Calendar PRO › Block all recurring events from a particular day (e.g., Crhist
- This topic has 4 replies, 3 voices, and was last updated 10 years, 1 month ago by
Support Droid.
-
AuthorPosts
-
December 3, 2015 at 9:48 am #1034798
Sean Sullivan
ParticipantHello:
One of my clients is a gym; we use the Events Calendar to list their class schedules, which consists of about 50 events per day. Everything in the calendar is a recurring event (e.g., every Wednesday).
However, we have no classes on holidays, like Christmas Day or New Years. But going in an adding exceptions for 50 events is tedious, and I’m hoping there’s a better way. Is there some code that will block all events on a certain date?
December 3, 2015 at 10:05 pm #1035218Cliff
MemberHi Sean. Interesting idea.
You could HIDE the events with CSS from the month view via this CSS:
[data-day="2015-12-10"] > .tribe_events { display: none; }However, this isn’t really recommended because, if someone used a different view (e.g. Week), it would NOT hide the events. If someone got the direct link to the event, that’d still work too, which is probably not what you’re wanting.
If you’re wanting a more strict “protection” (i.e. actually not working on those dates), you’d need to use PHP, such as our tribe_events_pre_get_posts hook.
Please let me know your feedback. Thanks.
December 11, 2015 at 10:51 am #1039735Sean Sullivan
ParticipantHey Cliff,
I’ve looked around in the documentation and forums to see if I can find some information on the tribe_events_pre_get_posts hook, but can’t find much.
Can you give me a nudge in the right direction — e.g., which template file I should look in to accomplish this?
Sean
December 11, 2015 at 9:30 pm #1039965Cliff
MemberThink of it like pre_get_posts but for event queries.
tribe_events_pre_get_posts is applied in these ways:
In the free/core plugin:
- add_action is located once in /wp-content/plugins/the-events-calendar/src/Tribe/Main.php
- do_action is located three times in /wp-content/plugins/the-events-calendar/src/Tribe/Query.php
In PRO add-on:
- add_action is located once in /wp-content/plugins/events-calendar-pro/src/Tribe/Geo_Loc.php
- and twice in /wp-content/plugins/events-calendar-pro/src/Tribe/Main.php
You can search our site and gists for possible additional help.
I hope this info helped! 🙂
February 18, 2016 at 8:32 am #1076156Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Block all recurring events from a particular day (e.g., Crhist’ is closed to new replies.
