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.
Contents
Parameters
- $posts
-
(null|array) (Optional) The posts to filter, a
nullvalue 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
Return
(array) An array of injected posts, or the original array of posts if no post injection is required.
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 );
}
}
Changelog
| Version | Description |
|---|---|
| 4.9.2 | Introduced. |