feat: template replacement
Some checks failed
Deploy WordPress and Nuxt / deploy (push) Has been cancelled

This commit is contained in:
2025-09-25 11:31:39 -04:00
parent 9f4d110d6e
commit 3119f29218
7 changed files with 122 additions and 7 deletions

View File

@@ -83,10 +83,11 @@ function ccat_get_graphql_preview_data() {
if ( empty( $layout_name = get_row_layout() ) ) {
throw new Exception( "Erreur de prévisualisation (section invalide)" );
}
$result = array(
$result = array(
'fieldGroupName' => ccat_get_graphql_field_group_name( 'group_abstract_builder', $layout_name ),
);
foreach ( get_row( true ) as $key => $value ) {
$format_value = $result['fieldGroupName'] !== '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;
}