Skip to content

Commit a72bcdc

Browse files
committed
- add the broken file back so we have a failing test
1 parent 190aea3 commit a72bcdc

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/FieldType/Taxonomy.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
class Taxonomy {
1010

1111
/**
12-
* Register support for the "taxonomy" ACF field type
1312
*/
1413
public static function register_field_type(): void {
1514
register_graphql_acf_field_type(
@@ -26,29 +25,22 @@ public static function register_field_type(): void {
2625
return null;
2726
}
2827

29-
$values = [];
3028
if ( ! is_array( $value ) ) {
31-
$values[] = $value;
32-
} else {
33-
$values = $value;
29+
$value[] = $value;
3430
}
3531

36-
$ids = array_map(
32+
$value = array_map(
3733
static function ( $id ) {
3834
return absint( $id );
3935
},
40-
$values
36+
$value
4137
);
4238

43-
if ( empty( $ids ) ) {
44-
return null;
45-
}
46-
4739
$resolver = new TermObjectConnectionResolver( $root, $args, $context, $info );
4840
return $resolver
4941
// Set the query to include only the IDs passed in from the field
5042
// and orderby the ids
51-
->set_query_arg( 'include', $ids )
43+
->set_query_arg( 'include', $value )
5244
->set_query_arg( 'orderby', 'include' )
5345
->get_connection();
5446
},

0 commit comments

Comments
 (0)