Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Created January 3, 2013 15:48
Show Gist options
  • Select an option

  • Save jo-snips/4444422 to your computer and use it in GitHub Desktop.

Select an option

Save jo-snips/4444422 to your computer and use it in GitHub Desktop.
The Events Calendar - Include Private Events in Calendar
add_action( 'pre_get_posts', 'include_private_events' );
function include_private_events( $query ) {
if ( $query->query_vars['post_type'] == TribeEvents::POSTTYPE && $query->query_vars['eventDisplay'] == 'month' && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_status',
array(
'publish',
'private'
)
);
}
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment