hook_filter_format_delete

Versions
7
hook_filter_format_delete($format, $fallback)

Perform actions when a text format has been deleted.

It is recommended for modules to implement this hook, when they store references to text formats to replace existing references to the deleted text format with the fallback format.

See also

hook_filter_format_update().

@see hook_filter_format_delete().

Parameters

$format The format object of the format being deleted.

$fallback The format object of the site's fallback format, which is always available to all users.

Related topics

Code

modules/filter/filter.api.php, line 249

<?php
function hook_filter_format_delete($format, $fallback) {
  // Replace the deleted format with the fallback format.
  db_update('my_module_table')
    ->fields(array('format' => $fallback->format))
    ->condition('format', $format->format)
    ->execute();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.