gestion accueil MAJ
This commit is contained in:
@@ -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,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user