Created
March 23, 2022 09:09
-
-
Save carlaizumibamford/eeee85d94a47b5a5d052c1c0c929590b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Display only posts with the ‘draft‘ status: | |
$query = new WP_Query( array( 'post_status' => 'draft' ) ); | |
Display multiple post status: | |
$args = array( | |
'post_status' => array( 'pending', 'draft', 'future' ) | |
); | |
$query = new WP_Query( $args ); | |
Display all attachments: | |
$args = array( | |
'post_status' => 'any', | |
'post_type' => 'attachment' | |
); | |
$query = new WP_Query( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment