crp_query_the_posts
Filter array of WP_Post objects before it is returned to the CRP_Query instance.
Type: filter
Since: 1.9
Source: includes/class-crp-core-query.php line 1398
Changelog
| Version | Description |
|---|---|
4.0.0 |
Added $instance |
2.9.3 |
Added $args |
1.9 |
Introduced. |
Parameters
| Type | Name | Description |
|---|---|---|
\WP_Post[] |
$posts |
Array of post objects. |
array |
$args |
Arguments array. |
\WP_Query|\CRP_Query |
$query |
The WP_Query or CRP_Query instance. |
CRP_Core_Query |
$instance |
The CRP_Core_Query instance. |
Usage
add_filter( 'crp_query_the_posts', function($posts, $args, $query, $instance) {
// ...
return $posts;
} );