Skip to content

Commit dd44bbf

Browse files
swissspidyclaude
andcommitted
Use pluralize helper for the missing term ID error
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UWTd5pwpi2xQfDA6mUYkkx
1 parent 8878f57 commit dd44bbf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/WP_CLI/CommandWithTerms.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public function add( $args, $assoc_args ) {
259259
if ( $field ) {
260260
$terms = $this->prepare_terms( $field, $terms, $taxonomy );
261261
if ( ! $terms ) {
262-
$id_label = count( $args ) > 1 ? 'IDs' : 'ID';
262+
$id_label = Utils\pluralize( 'ID', count( $args ) );
263263
WP_CLI::error( "Could not find any term with the given {$id_label}." );
264264
}
265265
}
@@ -314,7 +314,7 @@ public function set( $args, $assoc_args ) {
314314
if ( $field ) {
315315
$terms = $this->prepare_terms( $field, $terms, $taxonomy );
316316
if ( ! $terms ) {
317-
$id_label = count( $args ) > 1 ? 'IDs' : 'ID';
317+
$id_label = Utils\pluralize( 'ID', count( $args ) );
318318
WP_CLI::error( "Could not find any term with the given {$id_label}." );
319319
}
320320
}

0 commit comments

Comments
 (0)