Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use WPGraphQL\Model\Post;
use WPGraphQL\Model\Term;
use WPGraphQL\Model\User;
use WPGraphQL\Types;

/**
* Config class.
Expand Down Expand Up @@ -777,12 +776,21 @@ protected function register_graphql_field( $type_name, $field_name, $config ) {

$flex_field_layout_name = ! empty( $layout['name'] ) ? ucfirst( self::camel_case( $layout['name'] ) ) : null;
$flex_field_layout_name = ! empty( $flex_field_layout_name ) ? $field_type_name . '_' . $flex_field_layout_name : null;

/**
* If there are no layouts defined for the Flex Field
*/
if ( empty( $flex_field_layout_name ) ) {
continue;
}

$layout_type = $this->type_registry->get_type( $flex_field_layout_name );

if ( $layout_type ) {
$union_types[ $layout['name'] ] = $layout_type;
} else {


register_graphql_object_type( $flex_field_layout_name, [
'description' => __( 'Group within the flex field', 'wp-graphql-acf' ),
'fields' => [
Expand Down