I am trying to filter a tribe_get_events query to pull current user events, I stored the user’s id in a custom field but can’t seem to get it to fire right.. hoping someone sees my error…
global $post, $user;
get_currentuserinfo();
$currentid = $current_user->ID;
$all_events = tribe_get_events(
array(
‘eventDisplay’=>’upcoming’,
‘wpcf-xcustomer_id’=>$currentid,
));
foreach($all_events as $post) { stuff..
I’m sorry we were not able to get you a substantial reply today. I’m afraid this is above my head and I’ll need assistance from someone with more code experience to give you a thorough answer. We don’t do support over the weekend, but we’ll be back in touch with you asap next week to continue working through this.
Why wouldn’t you just use the author parameter in the query and pass the current user ID into that instead of messing with custom fields?
global $post, $user;
get_currentuserinfo();
$currentid = $current_user->ID;
$all_events = tribe_get_events(
array(
‘eventDisplay’=>’upcoming’,
‘author’=>$currentid,
));
foreach($all_events as $post) {
stuff..
}
Seems like the custom field route is an extra unnecessary step. Does that work?
– Jonah
Author
Posts
Viewing 4 posts - 1 through 4 (of 4 total)
The topic ‘Custom Fields with tribe_get_events’ is closed to new replies.