File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change 99class 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 },
You can’t perform that action at this time.
0 commit comments