Restricting results to the same category as the current post object
Limiting posts, pages, products or any custom post type results to only categories, or any taxonomy terms - where the post type object (post, page, product etc..) belongs to.
What is this, and where do I put this custom code?
$taxonomies (string) - comma separated list of taxonomies, where this code should apply to
$allow_missing (boolean) - in cases, when the resulting objects (posts, pages etc..) does not have the taxonomy assigned - should they be allowed as results. Ex.: Current page belongs to post_tag named Tag1. The search is configured to search posts and products as well, but products can not have assigned items from post_tag taxonomy. When
$allow_missing = false;
(default), all of the products will be excluded.$search_ids (string) - comma separated list of serach IDs, where the code should apply on. Assigning 'all' (default) value will apply on all search bars.
Last updated