1 file.api.php | hook_file_type_alter(array &$types, $file) |
Alters list of file types that can be assigned to a file.
Parameters
array $types: List of proposed types.
object $file: File object.
File
- core/
modules/ file/ file.api.php, line 451 - Hooks for file module.
Code
function hook_file_type_alter(array &$types, $file) {
// Choose a specific, non-first, file type.
$types = array($types[4]);
}