O'Reilly logo

Drupal 7 Development by Example Beginner's Guide by Kurt Madel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — implementing hook_uninstall for the Colorbox File module

The hook_uninstall function must be implemented in a module's .install file per the documentation available at http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_uninstall/7.

  1. In Aptana Studio, right-click on the colorbox_file folder at d7dev/sites/all/modules, and create a new file named colorbox_file.install.
  2. Open the colorbox_file.install file, and add the following code:
    <?php hook_uninstall functionhook_uninstall functionimplementing, for Colobrbox File Sandbox/** * @file * Uninstall function for the colorbox file module. */ /** * Implements hook_uninstall(). */ function colorbox_file_uninstall() { //Remove all colorbox_file varialbes db_delete('variable')->condition('name', ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required