crp_related_cache_clear_post_types
Filters the post types treated as able to appear in another post’s related posts.
Defaults to the post_types setting. A shortcode or block using a per-instance
post_types override can list a post type that the setting excludes; add it here so
that saving such a post also clears the lists that show it.
Type: filter
Since: 4.5.0
Source: includes/util/class-cache.php line 280
Parameters
| Type | Name | Description |
|---|---|---|
array |
$post_types |
Array of post type names. |
\WP_Post |
$post |
Post object being saved. |
Usage
add_filter( 'crp_related_cache_clear_post_types', function($post_types, $post) {
// ...
return $post_types;
} );