One would expect that a preferred menu link item would be that link item in a menu which is the default or primary menu link item for any particular path where more than one menu link exists in the same menu with the same link path. For example, when you create a new node instance which allows for menu link creation within the node edit form, it would be expected that when the node is fully loaded (therefore contains the property menu
as an array which is loaded via the invocation of hook_node_prepare
that is implemented by the menu module) the $node->menu
represents the preferred menu link for this node. While we can significantly rely on this method for any node's menu link when retrieved via a node object ($node->menu
), we cannot expect to be the same as what may be returned from menu_link_get_preferred('node/' . $node->nid)
. So which is the the correct preferred menu link?
With the expectation that $node->menu
represents the preferred menu link for th