You are here

function nodesymlinks_item_delete in NodeSymlinks 7

Same name and namespace in other branches
  1. 6 nodesymlinks.inc \nodesymlinks_item_delete()

Delete menulink and alias of given item.

It is not needed to have item fully loaded. Required keys are 'link_path' and 'mlid'.

1 call to nodesymlinks_item_delete()
_nodesymlinks_nodeapi_insert_update in ./nodesymlinks.inc
Implements hook_nodeapi() OP: Insert & Update.

File

./nodesymlinks.inc, line 13
Main NodeSymlinks callbacks

Code

function nodesymlinks_item_delete(stdClass $item) {

  // Delete alias.
  if (module_exists('path')) {
    path_delete(array(
      'source' => $item->link_path,
    ));
  }

  // Delete menu item.
  menu_link_delete($item->mlid);

  // Delete our stored copy.
  db_delete('nodesymlinks_link_storage')
    ->condition('mlid', $item->mlid)
    ->execute();
}