gestion accueil MAJ

This commit is contained in:
sebvtl728
2025-02-02 20:34:44 +01:00
parent f70d21ae71
commit 6eaa0fcf64
3 changed files with 188 additions and 160 deletions
@@ -278,10 +278,13 @@ add_action('rest_api_init', function () {
'acf', // Champ ACF
[
'get_callback' => function ($object) {
return get_fields($object['id']);
return get_fields($object['id']); // ✅ Vérifie que l'ID est correct
},
'update_callback' => function ($value, $object) {
return update_fields($object->ID, $value);
foreach ($value as $field_key => $field_value) {
update_field($field_key, $field_value, $object->ID); // ✅ Correction ici
}
return true;
},
'schema' => null,
]