function media_wysiwyg_entity_dependencies in D7 Media 7.3
Same name and namespace in other branches
- 7.4 modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc \media_wysiwyg_entity_dependencies()
- 7.2 modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc \media_wysiwyg_entity_dependencies()
Implements hook_entity_dependencies().
File
- modules/
media_wysiwyg/ includes/ media_wysiwyg.file_usage.inc, line 180 - Functions related to the tracking the file usage of embedded media.
Code
function media_wysiwyg_entity_dependencies($entity, $entity_type) {
// Go through all the entity's text fields and add a dependency on any files
// that are referenced there.
$dependencies = array();
foreach (media_wysiwyg_filter_parse_from_fields($entity_type, $entity) as $file_reference) {
$dependencies[] = array(
'type' => 'file',
'id' => $file_reference['fid'],
);
}
return $dependencies;
}