Commit ebb660cf authored by Dries's avatar Dries
Browse files

- Patch #1126370 by kim-day, jn2: menu_link_save() needs more detail.

parent 6c9563a4
...@@ -2899,18 +2899,26 @@ function _menu_delete_item($item, $force = FALSE) { ...@@ -2899,18 +2899,26 @@ function _menu_delete_item($item, $force = FALSE) {
} }
/** /**
* Save a menu link. * Saves a menu link.
*
* After calling this function, rebuild the menu cache using
* menu_cache_clear_all().
* *
* @param $item * @param $item
* An array representing a menu link item. The only mandatory keys are * An associative array representing a menu link item, with elements:
* link_path and link_title. Possible keys are: * - link_path: (required) The path of the menu item, which should be
* - menu_name: Default is navigation * normalized first by calling drupal_get_normal_path() on it.
* - weight: Default is 0 * - link_title: (required) Title to appear in menu for the link.
* - expanded: Whether the item is expanded. * - menu_name: (optional) The machine name of the menu for the link.
* - options: An array of options, see l() for more. * Defaults to 'navigation'.
* - mlid: Set to an existing value, or 0 or NULL to insert a new link. * - weight: (optional) Integer to determine position in menu. Default is 0.
* - plid: The mlid of the parent. * - expanded: (optional) Boolean that determines if the item is expanded.
* - router_path: The path of the relevant router item. * - options: (optional) An array of options, see l() for more.
* - mlid: (optional) Menu link identifier, the primary integer key for each
* menu link. Can be set to an existing value, or to 0 or NULL
* to insert a new link.
* - plid: (optional) The mlid of the parent.
* - router_path: (optional) The path of the relevant router item.
* *
* @return * @return
* The mlid of the saved menu link, or FALSE if the menu link could not be * The mlid of the saved menu link, or FALSE if the menu link could not be
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment