@@ -182,10 +182,6 @@ public function create( $args, $assoc_args ) {
182182 $ assoc_args ['post_category ' ] = $ this ->get_category_ids ( $ assoc_args ['post_category ' ] );
183183 }
184184
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-
189185 $ array_arguments = [ 'meta_input ' ];
190186 $ assoc_args = Utils \parse_shell_arrays ( $ assoc_args , $ array_arguments );
191187
@@ -351,10 +347,6 @@ public function update( $args, $assoc_args ) {
351347 $ assoc_args ['post_category ' ] = $ this ->get_category_ids ( $ assoc_args ['post_category ' ] );
352348 }
353349
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-
358350 $ array_arguments = [ 'meta_input ' ];
359351 $ assoc_args = Utils \parse_shell_arrays ( $ assoc_args , $ array_arguments );
360352
@@ -387,7 +379,7 @@ public function edit( $args, $assoc_args ) {
387379 $ result = $ this ->_edit ( $ post ->post_content , "WP-CLI post {$ post ->ID }" );
388380
389381 if ( false === $ result ) {
390- WP_CLI ::warning ( 'No change made to post content. ' , ' Aborted ' );
382+ WP_CLI ::warning ( 'No change made to post content. ' );
391383 } else {
392384 $ this ->update ( $ args , [ 'post_content ' => $ result ] );
393385 }
@@ -644,9 +636,12 @@ public function list_( $args, $assoc_args ) {
644636 $ query_args ['post_type ' ] = explode ( ', ' , $ query_args ['post_type ' ] );
645637 }
646638
639+ // To be fixed in wp-cli/wp-cli.
640+ // @phpstan-ignore property.notFound
647641 if ( 'ids ' === $ formatter ->format ) {
648642 $ query_args ['fields ' ] = 'ids ' ;
649643 $ query = new WP_Query ( $ query_args );
644+ // @phpstan-ignore argument.type
650645 echo implode ( ' ' , $ query ->posts );
651646 } elseif ( 'count ' === $ formatter ->format ) {
652647 $ query_args ['fields ' ] = 'ids ' ;
@@ -656,8 +651,13 @@ public function list_( $args, $assoc_args ) {
656651 $ query = new WP_Query ( $ query_args );
657652 $ posts = array_map (
658653 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 ;
661661 },
662662 $ query ->posts
663663 );
0 commit comments