Events+ Querying Events by User ID

Hi there,

Right now I'm using Events+ and have it set up so each event has the Group Event setting "This is a group event for ". This is connecting well with my BuddyPress group memberships. So when I use the upcoming events widget, it only includes events relevant to the current user based on their group memberships. This works great.

I'm trying to get an array of the next 5 upcoming events. I have this working and returning a JSON object successfully: https://gist.github.com/b18b225f9367085f59b8

My question is how to do this for a specific user ID. I need to add another argument to my function, upcoming_events_json( $user_id )

So no matter who is logged in, being able to query the upcoming events for another user

I can't see where this group membership filtering is happening in your code so I'm not sure where to begin. The function called from my gist has no reference to group/user ids and I didn't see any when searching up the class hierarchy either.

If you could give me an adjusted code snippet or point me in the right direction I'd definitely appreciate it!

Thanks,
Nathan