Skip to content

Commit 374d75e

Browse files
Copilotswissspidy
andcommitted
Fix format handling to show success messages for table format
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent fd5a464 commit 374d75e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WP_CLI/CommandWithTranslation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function update( $args, $assoc_args ) {
3737
Utils\format_items( $format, array(), array() );
3838
}
3939

40-
if ( ! $format || 'summary' === $format ) {
40+
if ( ! $format || in_array( $format, array( 'table', 'summary' ), true ) ) {
4141
WP_CLI::success( 'Translations are up to date.' );
4242
}
4343

@@ -174,7 +174,7 @@ public function update( $args, $assoc_args ) {
174174
Utils\format_items( $format, $results_data, array( $slug_key, 'language', 'status' ) );
175175
}
176176

177-
if ( ! $format || 'summary' === $format ) {
177+
if ( ! $format || in_array( $format, array( 'table', 'summary' ), true ) ) {
178178
$line = sprintf( "Updated $num_updated/$num_to_update %s.", WP_CLI\Utils\pluralize( 'translation', $num_updated ) );
179179

180180
if ( $num_to_update === $num_updated ) {

0 commit comments

Comments
 (0)