Hooks::filter_posts_pre_query( null|array $posts = null, WP_Query|null $query = null )

Filters the posts before the query runs but after its SQL and arguments are finalized to inject posts in it, if needed.


Parameters

$posts

(null|array) (Optional) The posts to filter, a null value by default or an array if set by other methods.

Default value: null

$query

(WP_Query|null) (Optional) The query object to (maybe) control and whose posts will be populated.

Default value: null


Top ↑

Return

(array) An array of injected posts, or the original array of posts if no post injection is required.


Top ↑

Source

File: src/Tribe/Views/V2/Hooks.php

	public function filter_posts_pre_query( $posts = null, \WP_Query $query = null ) {
		foreach ( $this->container->tagged( 'query_controllers' ) as $controller ) {
			/** @var Abstract_Query_Controller $controller */
			$controller->inject_posts( $posts, $query );
		}
	}

Top ↑

Changelog

Changelog
Version Description
4.9.2 Introduced.