Hide toolbar when admin_menu can be accessed

Public
</> CopyGet raw version
php
  1. /**
  2.  * Implements hook_page_alter().
  3.  */
  4. function MYMODULE_page_alter(&$page) {
  5. // Hide Toolbar for those who can access the Admin Menu.
  6. if (user_access('access administration menu') && !empty($page['page_top']['toolbar'])) {
  7. $page['page_top']['toolbar']['#access'] = FALSE;
  8. }
  9. }