Skip to content

Instantly share code, notes, and snippets.

@brettp
Created February 22, 2012 22:32
Show Gist options
  • Save brettp/1888009 to your computer and use it in GitHub Desktop.
Save brettp/1888009 to your computer and use it in GitHub Desktop.
Remove an item from a menu in Elgg
<?php
elgg_register_event_handler('init', 'system', 'remove_item_init');
function remove_item_init() {
elgg_register_plugin_hook_handler('register', 'menu:topbar', 'remove_friends');
}
function remove_friends($hook, $type, $menu_items, $option) {
foreach($menu_items as $i => $item) {
if ($item->getName() == 'friends') {
unset($menu_items[$i]);
}
}
return $menu_items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment