diff --git a/field_collection.module b/field_collection.module index 645093a..8eb6f76 100644 --- a/field_collection.module +++ b/field_collection.module @@ -1871,3 +1871,30 @@ function field_collection_devel_generate($object, $field, $instance, $bundle) { return array('value' => $field_collection->item_id); } + +/** + * Implements hook_rules_action_info(). + */ +function field_collection_rules_action_info() { + $actions = array( + 'field_collection_action_delete_item' => array( + 'label' => t('Delete field collection item'), + 'group' => t('Field Collection'), + 'parameter' => array( + 'item' => array( + 'type' => 'field_collection_item', + 'label' => t('Field collection item'), + ), + ), + ), + ); + + return $actions; +} + +/** + * Implements hook_action_delete_item(). + */ +function field_collection_action_delete_item($item) { + $item->delete(); +}