@@ -121,7 +121,7 @@ class Term_Command extends WP_CLI_Command {
121121 public function list_ ( $ args , $ assoc_args ) {
122122 foreach ( $ args as $ taxonomy ) {
123123 if ( ! taxonomy_exists ( $ taxonomy ) ) {
124- WP_CLI ::error ( "Taxonomy $ taxonomy doesn't exist. " );
124+ WP_CLI ::error ( "Taxonomy { $ taxonomy} doesn't exist. " );
125125 }
126126 }
127127
@@ -146,7 +146,7 @@ public function list_( $args, $assoc_args ) {
146146 if ( $ term && ! is_wp_error ( $ term ) ) {
147147 $ terms [] = $ term ;
148148 } else {
149- WP_CLI ::warning ( sprintf ( ' Invalid term %s. ' , $ term_id ) );
149+ WP_CLI ::warning ( " Invalid term { $ term_id} . " );
150150 }
151151 }
152152 } else {
@@ -229,7 +229,7 @@ public function create( $args, $assoc_args ) {
229229 if ( $ porcelain ) {
230230 WP_CLI ::line ( $ result ['term_id ' ] );
231231 } else {
232- WP_CLI ::success ( sprintf ( ' Created %s %d. ' , $ taxonomy, $ result ['term_id ' ] ) );
232+ WP_CLI ::success ( " Created { $ taxonomy} { $ result ['term_id ' ]} . " );
233233 }
234234 }
235235 }
@@ -440,7 +440,7 @@ public function delete( $args, $assoc_args ) {
440440
441441 // If term not found, then show error message and skip the iteration.
442442 if ( ! $ term ) {
443- WP_CLI ::warning ( sprintf ( " %s %s doesn't exist. ", $ taxonomy , $ term_id ) );
443+ WP_CLI ::warning ( "{ $ taxonomy } { $ term_id } doesn't exist. " );
444444 continue ;
445445 }
446446
@@ -455,10 +455,10 @@ public function delete( $args, $assoc_args ) {
455455 WP_CLI ::warning ( $ result );
456456 $ errors ++;
457457 } elseif ( $ result ) {
458- WP_CLI ::log ( sprintf ( ' Deleted %s %d. ' , $ taxonomy, $ term_id ) );
458+ WP_CLI ::log ( " Deleted { $ taxonomy} { $ term_id} . " );
459459 $ successes ++;
460460 } else {
461- WP_CLI ::warning ( sprintf ( " %s %s doesn't exist. ", $ taxonomy , $ term_id ) );
461+ WP_CLI ::warning ( "{ $ taxonomy } { $ term_id } doesn't exist. " );
462462 }
463463 }
464464 Utils \report_batch_operation_results ( 'term ' , 'delete ' , count ( $ args ), $ successes , $ errors );
@@ -522,7 +522,7 @@ public function generate( $args, $assoc_args ) {
522522 $ max_depth = $ final_args ['max_depth ' ];
523523
524524 if ( ! taxonomy_exists ( $ taxonomy ) ) {
525- WP_CLI ::error ( sprintf ( " '%s ' is not a registered taxonomy. ", $ taxonomy ) );
525+ WP_CLI ::error ( " ' { $ taxonomy } ' is not a registered taxonomy. " );
526526 }
527527
528528 $ label = get_taxonomy ( $ taxonomy )->labels ->singular_name ;
@@ -565,10 +565,10 @@ public function generate( $args, $assoc_args ) {
565565
566566 $ args = [
567567 'parent ' => $ current_parent ,
568- 'slug ' => $ slug . "- $ i " ,
568+ 'slug ' => $ slug . "- { $ i } " ,
569569 ];
570570
571- $ name = "$ label $ i " ;
571+ $ name = "{ $ label} { $ i } " ;
572572 $ term = wp_insert_term ( $ name , $ taxonomy , $ args );
573573 if ( is_wp_error ( $ term ) ) {
574574 WP_CLI ::warning ( $ term );
@@ -630,15 +630,15 @@ public function recount( $args ) {
630630 foreach ( $ args as $ taxonomy ) {
631631
632632 if ( ! taxonomy_exists ( $ taxonomy ) ) {
633- WP_CLI ::warning ( sprintf ( ' Taxonomy %s does not exist. ' , $ taxonomy ) );
633+ WP_CLI ::warning ( " Taxonomy { $ taxonomy } does not exist. " );
634634 } else {
635635
636636 $ terms = get_terms ( $ taxonomy , [ 'hide_empty ' => false ] );
637637 $ term_taxonomy_ids = wp_list_pluck ( $ terms , 'term_taxonomy_id ' );
638638
639639 wp_update_term_count ( $ term_taxonomy_ids , $ taxonomy );
640640
641- WP_CLI ::success ( sprintf ( ' Updated %s term count. ' , $ taxonomy ) );
641+ WP_CLI ::success ( " Updated { $ taxonomy } term count. " );
642642 }
643643 }
644644 }
0 commit comments