hook_toolbar_alter

hook_toolbar_alter(&$items)

Alter the toolbar menu after hook_toolbar() is invoked.

This hook is invoked by toolbar_view() immediately after hook_toolbar(). The toolbar definitions are passed in by reference. Each element of the $items array is one item returned by a module from hook_toolbar(). Additional items may be added, or existing items altered.

Parameters

$items: Associative array of toolbar menu definitions returned from hook_toolbar().

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/modules/toolbar/toolbar.api.php, line 163
Hooks provided by the toolbar module.

Code

function hook_toolbar_alter(&$items) {
  // Move the User tab to the right.
  $items['commerce']['#weight'] = 5;
}
doc_Drupal
2016-10-29 09:18:33
Comments
Leave a Comment

Please login to continue.