function _menu_delete_item


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 _menu_delete_item($item, $force = FALSE)
cle7 _menu_delete_item($item, $force = FALSE)
elmsmedia7 _menu_delete_item($item, $force = FALSE)
icor7 _menu_delete_item($item, $force = FALSE)
meedjum_blog7 _menu_delete_item($item, $force = FALSE)
mooc7 _menu_delete_item($item, $force = FALSE)

Deletes a single menu link.


$item: Item to be deleted.

$force: Forces deletion. Internal use only, setting to TRUE is discouraged.

See also


Related topics

3 calls to _menu_delete_item()
menu_delete_links in includes/
Deletes all links for a menu.
menu_link_delete in includes/
Delete one or several menu links.
_menu_navigation_links_rebuild in includes/
Builds menu links for the items in the menu router.


includes/, line 3018
API for the Drupal menu system.


function _menu_delete_item($item, $force = FALSE) {
  $item = is_object($item) ? get_object_vars($item) : $item;
  if ($item && ($item['module'] != 'system' || $item['updated'] || $force)) {
    // Children get re-attached to the item's parent.
    if ($item['has_children']) {
      $result = db_query("SELECT mlid FROM {menu_links} WHERE plid = :plid", array(':plid' => $item['mlid']));
      foreach ($result as $m) {
        $child = menu_link_load($m->mlid);
        $child['plid'] = $item['plid'];

    // Notify modules we are deleting the item.
    module_invoke_all('menu_link_delete', $item);

    db_delete('menu_links')->condition('mlid', $item['mlid'])->execute();

    // Update the has_children status of the parent.