Skip to content

Commit 4cb3fa8

Browse files
buntybuddybossschlessera
authored andcommitted
Minor fix
1 parent 37b2443 commit 4cb3fa8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Taxonomy_Command.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function list_( $args, $assoc_args ) {
149149
$formatter = $this->get_formatter( $assoc_args );
150150

151151
// Check if it's strict mode or not.
152-
$is_strict = ( isset( $assoc_args['strict'] ) && true === $assoc_args['strict'] ) ? true : false;
152+
$strict = Utils\get_flag_value( $assoc_args, 'strict', false );
153153

154154
unset( $assoc_args['strict'] );
155155

@@ -161,9 +161,10 @@ public function list_( $args, $assoc_args ) {
161161
}
162162

163163
$fields = $formatter->fields;
164-
$taxonomies = ( $is_strict ) ?
165-
get_taxonomies( $assoc_args, 'objects' ) :
166-
get_object_taxonomies( $taxonomy_object, 'objects' );
164+
$taxonomies = ( isset( $taxonomy_object ) && ! $strict )
165+
? get_object_taxonomies( $taxonomy_object, 'objects' )
166+
: get_taxonomies( $assoc_args, 'objects' );
167+
167168
$counts = [];
168169

169170
if ( count( $taxonomies ) > 0 && in_array( 'count', $fields, true ) ) {

0 commit comments

Comments
 (0)