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
1 2 3 4 | function hook_toolbar_alter(& $items ) { // Move the User tab to the right. $items [ 'commerce' ][ '#weight' ] = 5; } |
Please login to continue.