OSDN Git Service

Ensure `wp post list` returns posts of all statuses by default, as WP_Query behaves...
authorDaniel Bachhuber <d@danielbachhuber.com>
Sat, 27 Apr 2013 23:57:55 +0000 (16:57 -0700)
committerDaniel Bachhuber <d@danielbachhuber.com>
Sat, 27 Apr 2013 23:57:55 +0000 (16:57 -0700)
See #412

php/commands/post.php

index 7dec705..d58f90b 100644 (file)
@@ -164,7 +164,8 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
         */
        public function _list( $_, $assoc_args ) {
                $query_args = array(
-                       'posts_per_page' => -1
+                       'posts_per_page'  => -1,
+                       'post_status'     => 'any',
                );
 
                if ( ! empty( $assoc_args['format'] ) ) {