By shashwat purav on
foreach ($node->[FIELD_NAME][LANGUAGE_NONE] as $key => $value) {
// Build array of field collection values.
$field_collection_item_values[] = $value['value'];
// Unset them.
unset($node->[FIELD_NAME][LANGUAGE_NONE][$key]);
}
// Delete field collection items.
entity_delete_multiple('field_collection_item', $field_collection_item_values);
Comments
Hi, this code does delete the
Hi, this code does delete the field collection, but if you delete only some of them, the remaining deltas are not updated.
--
by FiNeX
FiNeX.org
Siti Web Vicenza