You are here

function hook_widgets_set_delete in Widgets 7

Respond to image set deletion.

This hook enables modules to update settings when a image set is being deleted. If a set is deleted, a replacement name may be specified in $set['name'] and the set being deleted will be specified in $set['old_name'].

Parameters

$set: The image set array that being deleted.

1 invocation of hook_widgets_set_delete()
widgets_set_delete in ./widgets.module
Delete an widget set.

File

./widgets.api.php, line 99
Hooks related to widget sets and widgets. TODO: Update API docs NOTICE: This file has been copied from the image module and has not been updated for use with Widgets yet.

Code

function hook_widgets_set_delete($set) {

  // Administrators can choose an optional replacement set when deleting.
  // Update the modules set variable accordingly.
  if (isset($set['old_name']) && $set['old_name'] == variable_get('mymodule_widgets_set', '')) {
    variable_set('mymodule_widgets_set', $set['name']);
  }
}