Tribe__Events__Templates::showInLoops( WP_Query $query )

Checks where we are are and determines if we should show events in the main loop


Parameters

$query

(WP_Query) (Required)


Top ↑

Return

(WP_Query)


Top ↑

Source

File: src/Tribe/Templates.php

		public static function showInLoops( $query ) {

			if ( ! is_admin() && tribe_get_option( 'showInLoops' ) && ( $query->is_home() || $query->is_tag ) && empty( $query->query_vars['post_type'] ) && false == $query->query_vars['suppress_filters'] ) {

				// @todo remove
				// 3.3 know-how for main query check
				if ( self::is_main_loop( $query ) ) {
					self::$isMainLoop = true;
					$post_types       = array( 'post', Tribe__Events__Main::POSTTYPE );
					$query->set( 'post_type', $post_types );
				}
			}

			return $query;
		}