I am using the plugin The Events Calendar Pro on a per-user basis, so I would like to modify the outputted calendar to display events for the current user only.
One of the support reps from the Tribe forum helped get me started with this, but I couldn't get it to work
add_action( 'pre_get_posts', 'show_posts_for_user' );
function show_posts_for_user( $query ) {
if ( $query->query_vars['eventDisplay'] == 'month' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
$current_user = wp_get_current_user();
$cid = $current_user->ID;
$query->set('author', '$cid');
}
return $query;
}