You could try this:
$args = array("post_type" => "mytype", "s" => $title, 'post_status => array('draft'));
$posts = get_posts( $args );
Related Posts:
- Using OR conditions in meta_query for query_posts argument
- Query post with meta_query where date is not in future
- When should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- WP_Query with “post_title LIKE ‘something%'”?
- Get post ids from WP_Query?
- Nested meta_query with multiple relation keys
- Some doubts about how the main query and the custom query works in this custom theme?
- Wp get all the sub pages of the parent using wp query
- Pagination with custom SQL query
- How to query for most viewed posts and show top 5
- WP Query where title begins with a specific letter
- WP_Query vs get_posts
- Whats the difference between post_limits and pre_get_posts?
- Query Posts in a Predefined Order
- Order posts by ID in the given order
- Is it possible to wrap Geo Location search around WP_Query?
- Query Multiple Post types each with own meta query
- Get posts by menu ID
- Get the number of posts from the current page results
- Is it possible to select against a post’s parent’s fields with WP_Query?
- WordPress Custom Query to show posts from last x years
- Query Custom Meta Value with Increment
- Extending WP_Query — Optimise SQL query
- How to know which one is the main query?
- Get posts by meta data OR title
- How to filter sql only for a specific post type
- Perform query with meta_value date
- Using is_main_query to select custom post type on certain page
- WP_Query ordered by custom field that is a date string?
- get query’s query string
- Meta Query with date and time on the same Day before given time
- get_the_title($postID) OR get_the_title()?
- How to make an activities stream mixing posts and comments?
- Display Posts by modifying the where clause only for my query
- SQL Statement generated by WP_Query not producing expected results
- What is an efficient way to query based on post_meta?
- SQL query equivalent to WP User Query
- How do I create my own nested meta_query using posts_where / posts_join?
- How to use filter hook posts_join for querying taxonomy terms in posts_where?
- Best practice for multiple queries on page
- Recommended way to drop a pending query (in pre_get_posts)?
- How to Get All Posts but the Private ones?
- how to retrieve specific product attribute value in an sql query?
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to find out what “Blog pages show at most” is set to [duplicate]
- Multiple search queries on one page
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- Pass the same object to multiple widgets in a template with one query
- Filter WordPress posts by between parameter
- Retrieve or Query Pages by ID
- SQL User Query by Multiple Roles using PHP
- Advanced WP Query hogs the SQL server
- SELECT * FROM $wpdb->posts WHERE ID > 160
- WP query exclude post within the last month / only show over 1 month old
- WordPress query for most recent posts from multiple categories
- How do you query wordpress posts using a math formula between multiple meta field values?
- How add a custom posttype name using ACF field to a query post array
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Too many posts cause slow load when paginating
- Page navigation doesn’t show when query category
- Multiple instances of Featured Image Query
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- How can I pick a single post from the latest 3?
- 2 loops on page – one with orderby rand second orderby date
- How do you Query posts with nothing in common?
- Next/Prev posts on same page
- WP User Query get all authors with last name starting with specific letter
- Custom category search box for WordPress
- Select from wp_post and multiple meta_value from wp_postmeta
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- How to correctly pass values to wpdb->prepare()?
- Query with custom taxonomy not working
- Query posts by specific word on title
- Sort users by “birthday” using WP_User_Query
- $wpdb select date range of posts
- How to query a custom post type with a taxonomy filter but display post type archive page?
- WP_Query last five posts, simply ordered by meta_value
- Order query by meta_value with multiple custom fields
- How To Fix WP Query Returns Results But Shouldn’t?
- Query with a meta value inside a given range
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- List of the years with posts presented
- WP_Query “OR”: Find posts by ID, Name or Post Title?
- Store sticky post’s ids in a transient
- Five posts from a category in footer
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Slow WP_Query for custom post type
- How to build a WP_Query using mulitple tags and using AND or OR operator between them
- Change query_posts to WP_Query in page but does not work
- Multiple loops without repeating content
- Complex WP SQL Query
- WP_Query condition affects posts_per_page count
- Query that loads a custom type AND posts whose ids are not inside those custom types custom fields
- Optional Meta Query
- Custom Query num_rows returns wrong amount
- How can I create ‘future’ and ‘past’ parameter for restAPI by filtering the CPT custom date field by greater than / less than current datetime?
- Serve specific “template” page at any URL that ends in its slug
- Sorting events by descending date, and ascending time if multiple events on a date
- Editing the default wordpress search