Created
May 27, 2019 14:01
-
-
Save jentheo/90eb416e50791ea30f700f427d6b8eef to your computer and use it in GitHub Desktop.
Set calendar to June in month view
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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