Skip to content

Instantly share code, notes, and snippets.

@jentheo
Created May 27, 2019 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jentheo/90eb416e50791ea30f700f427d6b8eef to your computer and use it in GitHub Desktop.
Save jentheo/90eb416e50791ea30f700f427d6b8eef to your computer and use it in GitHub Desktop.
Set calendar to June in month view
function tribe_set_default_date( $wp_query ) {
// Only run on main event queries
if ( ! tribe_is_event_query() || ! $wp_query->is_main_query() || $wp_query->get( 'eventDate' ) != '' ) return;
$date = '2019-06-01';
if (
tribe_is_month()
) {
$wp_query->set( 'eventDate', $date );
}
}
if ( function_exists( 'tribe_is_event_query' ) ) {
add_action( 'parse_query', 'tribe_set_default_date', 100 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment