Alter CP Menu with cp_menu_array
Adam Fairholm finds use for a (still undocumented) CP hook (as discovered by Rob Sanchez):
A few days ago Rob Sanchez tweeted a screenshot that caught my eye – a hook called cp_menu_array that is hanging out in expressionengine/libraries/Menu.php like it’s nothing special. It was added in EE 2.1.5.
/* -------------------------------------------
/* 'cp_menu_array' hook.
/* - Modify menu array
/* - Added: 2.1.5
*/
if ($this->EE->extensions->active_hook('cp_menu_array') === TRUE)
{
$menu = $this->EE->extensions->call('cp_menu_array', $menu);
}
/*
/* -------------------------------------------*/
Adam takes the hooks, builds an extension and shows you how to use it to customize the EE CP menus. Kaboom?