You are here

function menu_badges_uninstall in Menu Badges 8

Same name and namespace in other branches
  1. 7 menu_badges.install \menu_badges_uninstall()

Implements hook_uninstall().

File

./menu_badges.install, line 11
Install file for Menu Badges.

Code

function menu_badges_uninstall() {

  // Remove link badges from menu_links table.
  $result = db_query("SELECT mlid, options FROM {menu_links} WHERE options LIKE '%\"link_badge\"%'");
  foreach ($result as $record) {
    $options = unserialize($record->options);
    unset($options['link_badge']);
    db_query("UPDATE {menu_links} SET options = :options WHERE mlid = :mlid", array(
      ':options' => serialize($options),
      ':mlid' => $record->mlid,
    ));
  }
}