A user reported an issue with events created in private groups.
If a group member creates an event in a private group, other members of that group cannot view the event on the group event calendar.
The issue is due to the event being created with the private post status and WordPress doing a check on the read_private_events cap when our AJAX query runs to display events on the group calendar.
The interesting thing is the "Events > Upcoming" page does not require the read_private_posts cap check as we use eo_get_events() to grab the events and not the WP query loop.
The approach I've used in the PR is similar to what we do with the read_group_events cap check. I'm basically duplicating portions of that code to appease WordPress here.
A user reported an issue with events created in private groups.
If a group member creates an event in a private group, other members of that group cannot view the event on the group event calendar.
The issue is due to the event being created with the
private
post status and WordPress doing a check on theread_private_events
cap when our AJAX query runs to display events on the group calendar.The interesting thing is the "Events > Upcoming" page does not require the
read_private_posts
cap check as we useeo_get_events()
to grab the events and not the WP query loop.The approach I've used in the PR is similar to what we do with the
read_group_events
cap check. I'm basically duplicating portions of that code to appease WordPress here.Could use your feedback here, @boonebgorges