apply_filters( 'relevanssi_post_type_query_filter', string $query_restrictions, string|array $post_type, boolean $include_attachments, boolean $admin_search )

This filter hook filters the post type MySQL.


(string) The MySQL query restrictions.

(string or array) A post type parameter in string or array format.

(boolean) If true, attachments are to be included.

(boolean) If true, this is an admin search.

More information

When Relevanssi processes query variables, it converts them to MySQL query restrictions. This filter hook lets you modify the MySQL query for post type parameters.

The post type parameter becomes MySQL code that filters posts based on post type, both for inclusive and exclusive post types, and considering the users and taxonomy terms that don’t have a post type (or a post ID).