7.x filter.module filter_format_disable($format)

Disables a text format.

There is no core facility to re-enable a disabled format. It is not deleted to keep information for contrib and to make sure the format ID is never reused. As there might be content using the disabled format, this would lead to data corruption.

Parameters

$format: The text format object to be disabled.

3 calls to filter_format_disable()
FilterCRUDTestCase::testTextFormatCRUD in modules/filter/filter.test
Tests CRUD operations for text formats and filters.
FilterFormatAccessTestCase::testFormatWidgetPermissions in modules/filter/filter.test
Tests editing a page using a disallowed text format.
filter_admin_disable_submit in modules/filter/filter.admin.inc
Form submission handler for filter_admin_disable().

File

modules/filter/filter.module, line 299
Framework for handling the filtering of content.

Code

function filter_format_disable($format) {
  db_update('filter_format')
    ->fields(array('status' => 0))
    ->condition('format', $format->format)
    ->execute();

  // Allow modules to react on text format deletion.
  module_invoke_all('filter_format_disable', $format);

  // Clear the filter cache whenever a text format is disabled.
  filter_formats_reset();
  cache_clear_all($format->format . ':', 'cache_filter', TRUE);
}

Comments

rupam.iics’s picture

The best thing about drupal is it does not delete anything. I have Documented this process in detail here
http://www.integratedideas.co.in/grasshopper/drupal-7.4/?q=node/139
Check it out.