You are here

function hook_file_type_alter in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 8.2 file_entity.api.php \hook_file_type_alter()
  2. 7.2 file_entity.api.php \hook_file_type_alter()

Alters list of file types that can be assigned to a file.

Parameters

array $types: List of proposed types.

object $file: File object.

1 function implements hook_file_type_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

file_entity_features_pipe_file_type_alter in ./file_entity.module
Implements hook_features_pipe_alter() for the file type component.
2 invocations of hook_file_type_alter()
file_entity_get_filetype_candidates in ./file_entity.pages.inc
Get the candidate filetypes for a given file.
file_get_type in ./file_entity.file_api.inc
Determines file type for a given file.

File

./file_entity.api.php, line 380
Hooks provided by the File Entity module.

Code

function hook_file_type_alter(array &$types, $file) {

  // Choose a specific, non-first, file type.
  $types = array(
    $types[4],
  );
}