should_run_tribe_overrides() || ! is_array( $view ) ) { return $view; } // Don't proceed if we're not dealing with an X-theme view that doesn't have these params. if ( ! isset( $view['base'] ) || ! isset( $view['extension'] ) ) { return $view; } // Only interrupt the normal process if we're dealing with an excerpted "content" template. if ( 'framework/views/global/_content' === $view['base'] && 'the-excerpt' === $view['extension'] ) { remove_filter( 'x_get_view', [ $this, 'force_full_content' ], 10, 4 ); // Grab the global "content" template with full content. $view = x_get_view( 'global', '_content', 'the-content' ); add_filter( 'x_get_view', [ $this, 'force_full_content' ], 10, 4 ); } return $view; } /** * Use the filter as an action to remove further filtering on X theme side * if the query is for our content. * * @param string $template * * @return string $template */ public function filter_template_include( $template ) { if ( $this->should_run_tribe_overrides() ) { remove_filter( 'template_include', 'x_force_template_override', 99 ); } return $template; } /** * Checks if we're in a "main" calendar view, like Month View etc., where we want to apply our * various integration filters and overrides. * * @since 4.6.2 * * @return boolean */ public function should_run_tribe_overrides() { /** @var WP_Query $wp_query */ if ( ! $wp_query = tribe_get_global_query_object() ) { return; } return $wp_query->is_main_query() && empty( $wp_query->tribe_is_multi_posttype ) && ! empty( $wp_query->tribe_is_event_query ); } }