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
- Sending the reset password link programatically
- How to change upload directory in wp_handle_upload
- How do I directly access a PHP file located in my themes folder?
- Only show div on homepage/blog index in wordpress/php
- Calculate percentage of post by category
- file_exists() acting weird
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- register_rest_route regex option for base64 or alternate
- Is it possible to use the featured image of a page as a css background without inlining?
- PHP syntax error when using wpdb update?
- Select dropdown not showing selected value php
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Customized title tag for each page in pagination?
- items_wrap not working
- Can is_page() be combined with a switch control structure?
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- Using shipped version of jquery
- Run a filter when a walker runs
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- have_posts() execution failure
- WordPress with php 5.5 and zend opcache
- Can’t search posts using WP_QUERY inside AJAX Function
- How do I Add HTML to the_excerpt() & the_content() Output?
- Display fields as values in array from external SQL DB
- my posts are saved as drafts
- User’s total comment count excluding comments on their own posts
- Populate dropdown with Child Pages based on Parent Page chosen
- How can I remove a function that has been added to wordpress with add_filter?
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- do search in two site and show the result in first site
- Are there security or other issues with changing PHP time limit and max input vars?
- What’s the uses of wp_cache_set() or wp_cache_add()?
- How can I pass a custom/dynamic product to the Woocommerce cart?
- How to get post’s current parent term ID?
- Adding Taxonomy Image to taxonomy loop [closed]
- Irregular TTFB and server wait time response
- What does this mean in wordpress? Easy question
- How to get private property in parent class into extended class?
- Setting user nickname and displayname to shortened email
- Error Uncaught ArgumentCountError i cant find it
- Loop stopped working
- How does WordPress differentiate what scripts are loaded in wp_head() and wp_footer()?
- Download PDF after CF7 form submission
- 3 different times on my WordPress website
- Flexslider won’t work on WordPress
- Unable to Find Space in Custom Function
- Simple WordPress endpoint route doesn’t work
- Is it possible to create new user from external form using REST API?
- How do I create a function that modifies a message in the wp-login.php file?
- HTML dropdown setting not showing last saved value in the database
- Show the section only if custom taxonomy was chosen
- How do I make this Metabox show current DB value?
- Limit posts when visited with mobile devices
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Unable to Call More than One Meta Box Output
- Make a page (url) not cacheable [closed]
- Trying to display terms from custom taxonomy within function
- Most viewed posts in WordPress
- Is there a (offical) way for a theme to deactivate itself and show a message in admin?
- Trying to load category thumbnails on wordpress page
- Insert PHP code in Text
- Displaying a List of Changes / Updates on the Website Publicly
- Dropdown category field inside repeatable metabox
- How to extend SelectControl with data from my theme
- Retrieve alt text by referencing the img src
- How to add Text before my Custom Term and hide it when empty
- var_dump() and print_r() display null in php
- Don’t update modified post date when user add a product review or comment?
- Mysterious letters appearing at the top of a few pages
- Trouble matching strings (titles) using wp_query
- Current WordPress Page Title as Search Parameter into A Tag
- Limit the number of characters/words in an excerpt for a related posts section
- Yoast Breadcrumbs Inject Multiple Levels
- Maximum file Upload
- Customizer textarea with script tag won’t work in live preview
- How to give custom roles the capability to edit one Menu instead of every Menu
- Unzip_file causing Media file upload error
- Primary navigation menu with timed items from custom post type
- Styling a specific post after hovering over it
- Different Logo for Different Pages
- WooCommerce – Add Shipping class below each product in Shopping Cart page
- WordPress file upload
- Escaping a Single Quote in str_replace for Nav Function
- Use fetch_feed(); Totally Outside of WordPress?
- widget: input the px value from user and use it as inline style in widget function
- Create a dynamic buddupress tab
- Setting pages for posts
- Problems with plugin that fetches data from database with ajax
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- When I use rewind_post() it shows menu items in my loop
- Customise Author Page?
- How to create categories out of a list of words?
- Is there a way of displaying related posts from lowest hyrachical order (lowest child category to parent category)
- Difference between php memory limit and wp memory limit?
- How to change wp-admin and wp-login urls
- Product Search in search.php