function menu_delete_links

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

File

includes/menu.inc, line 3036
API for the Drupal menu system.

Code

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);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!menu.inc/function/menu_delete_links/7.x