Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Filtering View of Events Calendar Pro's Calendar WordPress


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;


Answers (1)


Arnav Joy answers:

so what are you getting this time using above filter...

Kyle comments:

Essentially, it is not working. It doesn't display anything