menu_delete_links

Versions
7
menu_delete_links($menu_name)

Deletes all links for a menu.

Parameters

$menu_name The name of the menu whose links will be deleted.

Related topics

▾ 4 functions call menu_delete_links()

menu_delete in modules/menu/menu.module
Delete a custom menu and all contained links.
shortcut_set_delete in modules/shortcut/shortcut.module
Deletes a shortcut set.
shortcut_set_save in modules/shortcut/shortcut.module
Saves a shortcut set.
shortcut_uninstall in modules/shortcut/shortcut.install
Implement hook_uninstall().

Code

includes/menu.inc, line 2476

<?php
function menu_delete_links($menu_name) {
  $links = menu_load_links($menu_name);
  foreach ($links as $link) {
    // To speed up the deletion process, we reset some link properties that
    // would trigger re-parenting logic in _menu_delete_item() and
    // _menu_update_parental_status().
    $link['has_children'] = FALSE;
    $link['plid'] = 0;
    _menu_delete_item($link);
  }
}
?>
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.