generated from pascalmartineau/wp-skeleton
refactor: fieldGroupName => __typename
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 58s
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 58s
This commit is contained in:
@@ -50,7 +50,7 @@ function ccat_acf_init() {
|
||||
}
|
||||
|
||||
// Helper: Get GraphQL field group name for flexible content layout
|
||||
function ccat_get_graphql_field_group_name( $field_group_key, $layout_name ) {
|
||||
function ccat_get_graphql_layout_typename( $field_group_key, $layout_name ) {
|
||||
$layout_type_name = \WPGraphQL\Utils\Utils::format_type_name( $layout_name );
|
||||
return "GroupAbstractBuilderSections{$layout_type_name}Layout";
|
||||
}
|
||||
@@ -84,9 +84,9 @@ function ccat_get_graphql_preview_data() {
|
||||
throw new Exception( "Erreur de prévisualisation (section invalide)" );
|
||||
}
|
||||
$result = array(
|
||||
'fieldGroupName' => ccat_get_graphql_field_group_name( 'group_abstract_builder', $layout_name ),
|
||||
'__typename' => ccat_get_graphql_layout_typename( 'group_abstract_builder', $layout_name ),
|
||||
);
|
||||
$format_value = $result['fieldGroupName'] !== 'GroupAbstractBuilderSectionsTemplateLayout';
|
||||
$format_value = $result['__typename'] !== 'GroupAbstractBuilderSectionsTemplateLayout';
|
||||
foreach ( get_row( $format_value ) ?: array() as $key => $value ) {
|
||||
if ( strpos( $key, 'acf_fc_layout' ) !== 0 && strpos( $key, '_' ) !== 0 ) {
|
||||
$result[ ccat_get_graphql_field_name( array( 'name' => $key ) ) ] = $value;
|
||||
|
||||
Reference in New Issue
Block a user