filter_format_disable

function filter_format_disable

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.

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);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!filter!filter.module/function/filter_format_disable/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部