@@ -182,10 +182,6 @@ public function create( $args, $assoc_args ) {
182
182
$ assoc_args ['post_category ' ] = $ this ->get_category_ids ( $ assoc_args ['post_category ' ] );
183
183
}
184
184
185
- if ( isset ( $ assoc_args ['meta_input ' ] ) && Utils \wp_version_compare ( '4.4 ' , '< ' ) ) {
186
- WP_CLI ::warning ( "The 'meta_input' field was only introduced in WordPress 4.4 so will have no effect. " );
187
- }
188
-
189
185
$ array_arguments = [ 'meta_input ' ];
190
186
$ assoc_args = Utils \parse_shell_arrays ( $ assoc_args , $ array_arguments );
191
187
@@ -351,10 +347,6 @@ public function update( $args, $assoc_args ) {
351
347
$ assoc_args ['post_category ' ] = $ this ->get_category_ids ( $ assoc_args ['post_category ' ] );
352
348
}
353
349
354
- if ( isset ( $ assoc_args ['meta_input ' ] ) && Utils \wp_version_compare ( '4.4 ' , '< ' ) ) {
355
- WP_CLI ::warning ( "The 'meta_input' field was only introduced in WordPress 4.4 so will have no effect. " );
356
- }
357
-
358
350
$ array_arguments = [ 'meta_input ' ];
359
351
$ assoc_args = Utils \parse_shell_arrays ( $ assoc_args , $ array_arguments );
360
352
@@ -387,7 +379,7 @@ public function edit( $args, $assoc_args ) {
387
379
$ result = $ this ->_edit ( $ post ->post_content , "WP-CLI post {$ post ->ID }" );
388
380
389
381
if ( false === $ result ) {
390
- WP_CLI ::warning ( 'No change made to post content. ' , ' Aborted ' );
382
+ WP_CLI ::warning ( 'No change made to post content. ' );
391
383
} else {
392
384
$ this ->update ( $ args , [ 'post_content ' => $ result ] );
393
385
}
@@ -644,9 +636,12 @@ public function list_( $args, $assoc_args ) {
644
636
$ query_args ['post_type ' ] = explode ( ', ' , $ query_args ['post_type ' ] );
645
637
}
646
638
639
+ // To be fixed in wp-cli/wp-cli.
640
+ // @phpstan-ignore property.notFound
647
641
if ( 'ids ' === $ formatter ->format ) {
648
642
$ query_args ['fields ' ] = 'ids ' ;
649
643
$ query = new WP_Query ( $ query_args );
644
+ // @phpstan-ignore argument.type
650
645
echo implode ( ' ' , $ query ->posts );
651
646
} elseif ( 'count ' === $ formatter ->format ) {
652
647
$ query_args ['fields ' ] = 'ids ' ;
@@ -656,8 +651,13 @@ public function list_( $args, $assoc_args ) {
656
651
$ query = new WP_Query ( $ query_args );
657
652
$ posts = array_map (
658
653
function ( $ post ) {
659
- $ post ->url = get_permalink ( $ post ->ID );
660
- return $ post ;
654
+ /**
655
+ * @var \WP_Post $post
656
+ */
657
+
658
+ // @phpstan-ignore property.notFound
659
+ $ post ->url = get_permalink ( $ post ->ID );
660
+ return $ post ;
661
661
},
662
662
$ query ->posts
663
663
);
0 commit comments