As documented you can set the post_status argument to 'any' to retrive
…any status except those from post statuses with ‘exclude_from_search’ set to true (i.e. trash and auto-draft).
So:
$args['post_status'] = 'any';
Related Posts:
- How to get Post Type from the functions.php file
- Replace Post-Title with variable
- Filter by Post Type
- Permalink like example.com/taxonomy/post_type/postname
- Post returns 404 after changing the permalink using post_type_link
- Best way to do multiple constructors in PHP
- Is there a way for a plugin to add an attribute to the tag of a theme?
- wp_set_object_terms and arrays
- How to create custom php script page
- Moving a PHP web-app to WordPress
- How do i hide the if the appears
- How to use WordPress (PHP) functions in AngularJS partials files?
- WordPress 4 invalid username special charachters issue
- Concatenate site_url and string doesn’t work
- My shortcode is showing up twice
- Use ajax to update_post_meta
- When did wordpress switched requirements to php7?
- 1+1 php counter inside the update_post_meta
- How do I test PHP files in WordPress?
- echo CHILD / SUB CATEGORIES of the CURRENT CATEGORY only
- Custom Template 404 for specific custom post type
- Correct syntax to html php conversion
- WSoD being caused by this piece of code
- How to display data from custom table in wordpress phpmyadmin
- how do I get a specific post from a post with a subcategory in WP
- Remove the first 5 characters of the_title and orderby that
- Replacing mysql_escape_string in a custom plugin when moving to PHP7
- running wp-cron.php using php not wget
- Theme developement – incative sidebars
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Scrape external webpage for first image and add it to new post
- PHP echoes value without the use of echo
- Get URL from shortcode tag
- How can i show post_class() within output loop?
- How to remove ?p= from wordpress short links
- Hide image if taxonomy term is empty
- Could use some help with Shortcodes
- Use custom template on custom post type
- Do I always need to call wp_get_current_user() before accessing $current_user?
- How to make function appear in sentence?
- Save html content of a widget textarea
- Widgets not showing on custom theme
- How to define a variable already defined in a plugin function?
- Custom query vars filters problem with pagination
- How do I access post_meta key with php?
- How to modify mobile nav menu text in theme
- How to use AJAX in WordPress in MYSQL query?
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- php return username of currently viewed author profile
- Update value of a associative array with update_post_meta
- feedburner plugin for WP 3.5
- Redirect to current user page upon link click
- Adding wp_list_categories to a specific div that was appended using jQuery
- WordPress custom post type and taxonomy
- PHP code snippet to remove microdata
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- how to dynamically remove all edit and delete functionality of a page
- Generate a QR code when creating a new WordPress user
- Passing in MySQL prepare statement parameter separately throwing error
- I want to fusion the product columns in email table order
- wordpress email checker on domain
- Critical error on your site
- posts_per_page displays only 2 posts instead of 4 posts
- Woocommerce – get daily sales meta
- update_user_meta not working
- Custom woocommerce payment gateway – Form
- wordpress notice
- ajax contact form not submit message
- Show different number of posts on first Blog listing page
- After using ssl certificate, wordpress doesn’t work
- use with class file into wp_ajax hook
- Trying to add get_the_title hook to this line
- WAMP SERVER Command Prompt SET PATH=%PATH%
- Change username link in admin bar
- Update all posts in custom post types with wp_cron()?
- Child theme not visible in backend
- how to check if the post id has a new comment?
- php if, else & custom fields – syntax error
- How to create “page” used for generating PDF? [closed]
- “Where… like” query not working as expected
- Why isn’t my custom function kicking in from my functions.php file?
- Shortcoding with Divs
- Reusing the page name class that WordPress adds to body tag
- Custom Links in Walker Class
- How to include support for all page types, calendar urls, archive, etc
- Integrating CSS Into a WP Function Call [closed]
- WordPress menu links with images & class selection
- Use php array outside his function
- How do I remove blog entries from home page Twenty Eleven child theme?
- PHP 7.3 is required for WordPress 5.2 or Recommendation
- how to get image url from meta value?
- Show wrapper divs if query has results, then loop the results [closed]
- How make wp_nav() with my css?
- Suddenly sessions and header location not working
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- bloginfo url in javascript
- AJAX returning blank result
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- How can I display a Divi content inside a modal based on an AJAX request