function file_type_delete


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 file_type_delete($type)
cle7 file_type_delete($type)
elmsmedia7 file_type_delete($type)
icor7 file_type_delete($type)
meedjum_blog7 file_type_delete($type)
mooc7 file_type_delete($type)

Deletes a file type from the database.

This function can be called on its own, or via the CTools exportables 'delete callback' for {file_type} objects.


object|string $type: Either a loaded file type object or the machine-name of the type.

Related topics

4 calls to file_type_delete()
file_entity_type_delete_confirm_submit in sites/all/modules/ulmus/file_entity/
Process file type delete confirm submissions.
file_entity_type_revert_confirm_submit in sites/all/modules/ulmus/file_entity/
Process file type delete confirm submissions.
file_entity_uninstall in sites/all/modules/ulmus/file_entity/file_entity.install
Implements hook_uninstall().
media_upgrade_file_types_confirm_submit in sites/all/modules/ulmus/media/includes/
File types migration confirmation page sumit. Executes actual migration.
2 string references to 'file_type_delete'
file_entity_schema in sites/all/modules/ulmus/file_entity/file_entity.install
Implements hook_schema().
file_entity_update_7201 in sites/all/modules/ulmus/file_entity/file_entity.install
Add the {file_type}, {file_type_mimetypes} tables.


sites/all/modules/ulmus/file_entity/, line 568
API extensions of Drupal core's


function file_type_delete($type) {
  $type = is_string($type) ? file_type_load($type) : $type;

  db_delete('file_type')->condition('type', $type->type)->execute();

  // Remove this type from CToolS status variable.
  $status = variable_get('default_file_type', array());
  variable_set('default_file_type', $status);


  // After deleting from the database, check if the type still exists as a
  // code-provided default type. If not, consider the type fully deleted and
  // invoke the needed hooks.
  if (!file_type_load($type->type)) {
    field_attach_delete_bundle('file', $type->type);
    module_invoke_all('file_type_delete', $type);