function media_library_field_info_alter in Media Library 7
Implements hook_field_info_alter().
File
- ./
media_library.module, line 80 - Restricts the media library to only designated files.
Code
function media_library_field_info_alter(&$info) {
// Add the 'include in library' instance setting to file and image fields.
foreach ($info as $field_type => &$field_type_info) {
if ($field_type == 'file' || $field_type == 'image') {
$field_type_info += array(
'instance_settings' => array(),
);
$field_type_info['instance_settings'] += array(
'media_library_include_in_library' => FALSE,
);
}
}
}