Template_Bootstrap::should_load( WP_Query $query = null )
Determines when we should bootstrap the template for The Events Calendar
Contents
Parameters
- $query
-
(WP_Query) (Optional) Which WP_Query object we are going to load on
Default value: null
Return
(boolean) Whether any template managed by this class should load at all or not.
Source
File: src/Tribe/Views/V2/Template_Bootstrap.php
public function should_load( $query = null ) {
if ( ! $query instanceof \WP_Query ) {
$query = tribe_get_global_query_object();
}
if ( ! $query instanceof \WP_Query ) {
return false;
}
/**
* Bail if we are not dealing with an Event, Venue or Organizer main query.
*
* The `tribe_is_event_query` property is a logic `OR` of any post type and taxonomy we manage.
*
* @see \Tribe__Events__Query::parse_query() where this property is set.
*/
return $query->is_main_query() && ! empty( $query->tribe_is_event_query );
}
Changelog
| Version | Description |
|---|---|
| 4.9.2 | Introduced. |