You are right, I tried it in a clean WordPress install and it works.
Seems like one of the plugins I use in my environment is hooking itself in one of the pre-query events.
Thanks!
Related Posts:
- AJAX search on post pages by custom post type
- Search multiple custom fields by using meta_query
- Search Custom Post Type with all meta attached?
- How Do I Use WP_Query to Run This Database Query as Search Result?
- Search tags in CPTs
- Including Custom Meta with posts_where query
- Including metaboxes from custom post types in global search — continued
- Advanced search form with filters for custom taxonomies
- Custom filter for main search: how to exclude specific post_type from search results
- how to get this tax_query working?
- Select2 AJAX and WP Query Returns ALL and does not filter
- find custom post type post by searching its custom field with my string
- Searching post types
- Change search query in wordpress custom post type
- Search Function not searching correct custom_post_type even though post_type is defined in search args
- post_type incorrect for custom post type
- Live search by custom tag
- Create Second Search Page Only for Custom Post Type
- Conditional posts in WP_query for search
- Manually build WP_Query
- WP_Query with custom post type search showing all results every time
- Custom post type blog pagination conflict
- Customising wordpress search and using $_GET[“s”]
- Why does ‘exclude_from_search’ exclude a custom post type from WP_Query?
- Searching Custom Posts content with JQuery
- Custom post archive with search, is_search() is false?
- Advanced search form with filters for custom taxonomies and custom fields
- How to put custom post types on front page
- Add custom post type items from frontend
- Listing posts with wp-cli
- How do I get a meta value from WP_Query?
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Custom Search | Wrong output & question
- Group search results by post type, but hide post types with no results
- How to filter by custom post type in taxonomy archive pages
- Set meta_query only for specific post type
- How do I Use Nested Loops of Custom Post Types for MultiSite Blogs using WP_Query()
- Get the next event using date_query
- Impossible to get Attachments Outside WordPress?
- Woocommerce query specific product from specific category
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Get custom posts with certain ids in a custom loop using a shortcode
- wpdb custom post_type problem
- Pagination on category page with custom post types
- Query custom post type in the loop
- Show custom post type filtered by category
- Filtering WP_Query
- Custom post taxonomies as tax_query terms?
- Troubles with acf/save_post and WP_Query
- Query custom post type with ACF Date
- Custom post type ‘articles’ ignores posts_per_page, reserved post_type?
- WP Query with categories only shows one post and ignores the category
- WordPress request fiter order by related post’s post_title
- Searching Custom Post Types
- Can I display custom post types in home.php or need page template?
- Sort posts in loop by the WooCommerce Membership of the author
- WordPress wp_query() basic question about args
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- How to get the post terms from a child taxonomy
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Pagination for search results of custom post type [duplicate]
- WP_Query get post from a category and from another post type
- Custom Plugin – Query CPT – Display Results
- foreach loop inside the loop creating duplicates in output
- Sorting by meta_key different to search criteria?
- All blog posts are not showing up
- Search CPT Title AND Meta
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Custom post-type custom query – show all posts
- meta query condition don’t work
- Filter posts by their related field’s custom field
- Search only one custom post type
- Custom post type category returns null
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- Query a Custom Post Type using SELECT that has ACF fields to compare dates
- Tell wordpress to show a single page instead of an archive page
- How to get post by meta value
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- How do I get all authors posts of a custom post type outside loop
- minimize wp_query call to database
- sorting in wp query based on custom field value
- Include images from pages in wp search.php results in default wp search
- WordPress loop add heading before first of type
- Only show current category post
- Post search not looking at post title since 4.4.2 upgrade
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- WP_Query for CPT with filter by another WP_Query
- Is it possible to add query parameters on the archive page?
- Custom Search not working
- WP_Query and two custom fields returns no posts
- Is it good practice to search for custom posts based on custom field values?
- Storing/querying custom date data
- Query Posts From Multiple Post Types
- Custom Post-type not returning the right child_of
- How do I hide single category post on my post page
- querying to custom field over ACF REST API
- WordPress custom field sorting, weird behavior: the latest post is at the end
- Default WordPress Query for a Specific Custom Post Type URL
- Dynamically count the number of custom post types associated to a custom taxonomy