You should create pre_get_posts
filter and trigger in the $query->is_search()
to check if post_type
is set to author
and if it is then unset post_type
to posts or what evver you want and set author parametrs to $query
object.
related links:
https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
Or you should create another select, listing all users and give it a name of Author Parametrs
found in wp_query
Related Posts:
- How to create a custom search for custom post type?
- Search multiple custom fields by using meta_query
- Search results ordered by custom post types are not grouped
- How to create an advanced filter search?
- Custom search for custom post meta with pre_get_posts interferes with WP search
- WordPress sort search results by custom order
- How to have multiple search result pages in wordpress with taxonomy terms listed
- Search for custom field input of a custom post type in ajax live search
- Multiple meta_values in the pre_get_posts filter?
- How to order separated Custom Post Search results
- Permalink structure by Post Meta value
- How to integrate video slide using custom post types?
- search also in taxonomy, tags and custom fields
- Custom post type search using $_SESSION and pre_get_posts
- How to stick custom post at the top in search results
- filter custom post type by meta key in dashboard
- Can I search only some of the fields of a custom post type?
- Custom Post Type And “fopen”
- A question on creating filters for custom posts using taxonomy
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- Define new user capability for custom post types?
- Filter custom posts using auto populated dropdown selectors
- How to allow visitors to enter custom post type?
- Is it possible to create relational metabox values in a custom post?
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- Make parts of your wordpress website completely built with data from external APIs?
- 2 Templates 1 custom post type according url
- How do I move/order posts with a tag to the end?
- changing meta value and meta key of price field
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- Hide parent categories when clicked, and show it’s childs
- Custom Path/Folder behind a custom post type
- Time based access control of custom post types – what is good approach?
- Show titles, date of all posts on single category page
- Including metaboxes from custom post types in global search — continued
- Custom post type not showing in search result
- delete_published_posts does not work
- How to start a new post with custom Taxonomies already set?
- WooCommerce sort products by the actual product width(not the shipping width)
- Create a custom php page and load it at a specific slug
- Structure of data : CPT + terms
- How to handle paged param in post and custom-post-type?
- Default text in a specific post type, but not visible?
- Update postmeta Parent when post_status child change
- What to and how to proceed with CPT to make DB small and efficient?
- Pretty URL for custom search for custom post type
- Add post location with mile radius allowing search
- WP_Query custom post type query not showing the exact post type
- Include custom post type content in search
- Get post count for search result based on post type
- Shortcode to display Staff post type based on Location post type and Specialty post type
- Auto Complete Search
- How to remove post listing page for a custom post type
- How to include term custom meta into the custom taxonomy term permalink structure
- search suggest – filter post type
- Searching Custom Post Types
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- A form that can save/edit after first input
- Adding the_content() in custom template email
- Cannot save CPT meta box
- non-hierarchical post type with hierarchical url structure
- Send notification to the admin when new custom post is submitted
- Allow users to create posts without logging in?
- How to add attributes to taxonomies that may be different from post to post?
- Pages are not saving due to custom post type
- Remotely search WordPress sites using xml-rpc
- Migrating a taxonomy’s tags to the native category
- BBPress Search results in WordPress search
- Limit Search to Post Type With Apostrophe return search not found
- Search filter triggered & sort by custom post type
- Set Custom Post Type in Widget Settings for use in Widget
- Displaying and searching Custom Posts
- Search by tag name and category
- How to produce a sub-page-system in WordPress
- Searching Custom Fields
- Advanced search form with filters for custom taxonomies
- dropdowboxes with pre-selected custom fields optios that filters the results according seach needs
- filter search custom field query
- Different results between permalink and query var search
- Best structure / rewrite rules to achieve the following url
- How to let users choose where to search for posts?
- WordPress Custom Search by post_type
- don’t publish custom post type post if a meta data field isn’t valid
- Include custom taxonomy term in search
- How does order=asc effect a wp_query (its acting pretty weird in a loop)
- How to sort posts in a custom post type by title in ascending order by default?
- Categorise Custom Post Types
- What content types are shown at a search page?
- Can NOT search my custom post type?
- Detect inside a custom query the kind of post type to assign custom classes
- Search one custom post type ONLY, disable “all posts”
- custom post type vs. conditionally displaying meta boxes for specific terms?
- Edit the_content() function so to add a div wrapper
- How do you make a custom post type items automatically delete items 3 months after publication?
- Custom Post Type & Custom Menu Walker to append custom class for active post types
- Number of posts in the archive
- custom post data – how to