@@ -429,10 +429,9 @@ private function call( $args, $status, $success, $failure ) {
429429 $ func = "wp_ {$ status }_comment " ;
430430
431431 if ( ! $ func ( $ comment_id ) ) {
432- WP_CLI ::error ( "{ $ failure} comment {$ comment_id }. " );
432+ WP_CLI ::error ( sprintf ( $ failure, " comment {$ comment_id }" ) );
433433 }
434-
435- WP_CLI ::success ( "{$ success } comment {$ comment_id }. " );
434+ WP_CLI ::success ( sprintf ( $ success , "comment {$ comment_id }" ) );
436435 }
437436
438437 private function set_status ( $ args , $ status , $ success ) {
@@ -473,7 +472,7 @@ private function check_server_name() {
473472 */
474473 public function trash ( $ args , $ assoc_args ) {
475474 foreach ( $ args as $ id ) {
476- $ this ->call ( $ id , __FUNCTION__ , 'Trashed ' , 'Failed trashing ' );
475+ $ this ->call ( $ id , __FUNCTION__ , 'Trashed %s. ' , 'Failed trashing %s. ' );
477476 }
478477 }
479478
@@ -494,7 +493,7 @@ public function trash( $args, $assoc_args ) {
494493 public function untrash ( $ args , $ assoc_args ) {
495494 $ this ->check_server_name ();
496495 foreach ( $ args as $ id ) {
497- $ this ->call ( $ id , __FUNCTION__ , 'Untrashed ' , 'Failed untrashing ' );
496+ $ this ->call ( $ id , __FUNCTION__ , 'Untrashed %s. ' , 'Failed untrashing %s. ' );
498497 }
499498 }
500499
@@ -514,7 +513,7 @@ public function untrash( $args, $assoc_args ) {
514513 */
515514 public function spam ( $ args , $ assoc_args ) {
516515 foreach ( $ args as $ id ) {
517- $ this ->call ( $ id , __FUNCTION__ , 'Marked as spam ' , 'Failed marking as spam ' );
516+ $ this ->call ( $ id , __FUNCTION__ , 'Marked %s as spam. ' , 'Failed marking %s as spam. ' );
518517 }
519518 }
520519
@@ -535,7 +534,7 @@ public function spam( $args, $assoc_args ) {
535534 public function unspam ( $ args , $ assoc_args ) {
536535 $ this ->check_server_name ();
537536 foreach ( $ args as $ id ) {
538- $ this ->call ( $ id , __FUNCTION__ , 'Unspammed ' , 'Failed unspamming ' );
537+ $ this ->call ( $ id , __FUNCTION__ , 'Unspammed %s. ' , 'Failed unspamming %s. ' );
539538 }
540539 }
541540
0 commit comments