Recent

crp_posts_post_typesfilter

crp_posts_post_types

Filter the post_types passed to the query.

Type: filter
Since: 2.2.0
Source: includes/class-crp-core-query.php line 325

Changelog

Version Description
3.0.0 Changed second argument from post ID to WP_Post object.
2.2.0 Introduced.

Parameters

Type Name Description
array $post_types Array of post types to filter by.
\WP_Post $source_post Source Post instance.
array $args Arguments array.

Usage

add_filter( 'crp_posts_post_types', function($post_types, $source_post, $args) {
    // ...
    return $post_types;
} );