@@ -45,7 +45,6 @@ static function ( $cloned ) use ( $field_config ) {
4545 );
4646
4747 if ( ! empty ( $ cloned_group_interfaces ) ) {
48-
4948 if ( ! $ prefix_name ) {
5049 register_graphql_interfaces_to_types ( $ cloned_group_interfaces , [ $ parent_type ] );
5150 } else {
@@ -97,79 +96,8 @@ static function ( $cloned ) use ( $field_config ) {
9796 return $ type_name ;
9897 }
9998 }
100-
10199 // Bail by returning a NULL type
102100 return 'NULL ' ;
103-
104-
105-
106-
107- //
108- // $cloned_groups = [];
109- // if ( ! empty( $sub_field_group['clone'] ) && is_array( $sub_field_group['clone'] ) ) {
110- // foreach ( $sub_field_group['clone'] as $cloned_from ) {
111- // if ( ! acf_get_field_group( $cloned_from ) ) {
112- // continue;
113- // }
114- // if ( ! in_array( $cloned_from, $cloned_groups, true ) ) {
115- // $cloned_groups[] = acf_get_field_group( $cloned_from );
116- // }
117- // }
118- // }
119- //
120- // $cloned_group_interfaces = [];
121- //
122- // if ( ! empty( $cloned_groups ) ) {
123- // foreach ( $cloned_groups as $cloned_group ) {
124- // $cloned_group_interfaces[] = $field_config->get_registry()->get_field_group_graphql_type_name( $cloned_group ) . '_Fields';
125- // }
126- // }
127- //
128- // if ( ! empty( $cloned_group_interfaces ) ) {
129- //
130- // // If a clone field clones all fields from another field group,
131- // // but has "prefix_name" false, implement the Interface on the parent group
132- // if ( false === (bool) $sub_field_group['prefix_name'] ) {
133- // $parent_group = acf_get_field_group( $sub_field_group['parent'] );
134- //
135- // if ( empty( $parent_group ) ) {
136- // $parent_field = acf_get_field( $sub_field_group['parent'] );
137- // $parent_group = ! empty( $parent_field ) ? acf_get_field_group( $parent_field['parent'] ) : false;
138- // }
139- //
140- // if ( ! empty( $parent_group ) ) {
141- // $parent_group_type_name = $field_config->get_registry()->get_field_group_graphql_type_name( $parent_group );
142- //
143- // if ( isset( $sub_field_group['isFlexLayoutField'] ) && true === (bool) $sub_field_group['isFlexLayoutField'] ) {
144- // $parent_type_name = $field_config->get_registry()->get_field_group_graphql_type_name( $sub_field_group['parent_layout_group'] ) ?? $type_name;
145- // register_graphql_interfaces_to_types( $cloned_group_interfaces, [ $parent_type_name ] );
146- // } else {
147- // register_graphql_interfaces_to_types( $cloned_group_interfaces, [ $parent_group_type_name ] );
148- // }
149- // return 'connection';
150- // }
151- // // If "prefix_name" is true, nest the cloned field group within another GraphQL object type to avoid
152- // // collisions with multiple instances of the field group being cloned
153- // } else {
154- // if ( ! empty( $type_name ) ) {
155- // // Register the cloned group interfaces to the type representing the cloned fields
156- // register_graphql_interfaces_to_types( $cloned_group_interfaces, [ $type_name ] );
157- // }
158- // }
159- // }
160- //
161- //
162- // $sub_field_group['graphql_type_name'] = $type_name;
163- // $sub_field_group['graphql_field_name'] = $type_name;
164- // $sub_field_group['parent'] = $sub_field_group['key'];
165- //
166- // $field_config->get_registry()->register_acf_field_groups_to_graphql(
167- // [
168- // $sub_field_group,
169- // ]
170- // );
171- //
172- // return $type_name;
173101 },
174102 // The clone field adds its own settings field to display
175103 'admin_fields ' => static function ( $ default_admin_settings , $ field , $ config , \WPGraphQL \Acf \Admin \Settings $ settings ) {
0 commit comments