How to remove "friends" menu item from topbar 1.7

Quick question, where is the add menu item function for "friends" in the topbar?  I want to remove it but I cant find it anywhere.  Ive searched this site all day and Ive only found solutions for 1.8 I'm using 1.7.

  • lolz;-P
    i always use //:DC: to mark code as i change 'em, usually also with datestamp..
    e.g. //:DC:2012-06-18:= this code is is for yadda yadda yadda....
    standard...programming practice

    yep - just try the remove menu above into blog's/ start.php ;-oO
    no towels yet ;-P and you can patch into your plugIn later..

    y yo en 'trip' muy lejos desde USA ahora ;-P I am pretty far away out of the US right now.. so humor me.. take the code which i've taken time out from my other business(es) here to discuss.. and *make it work.. ;-oO




  • hahaha thanks but no go.  I dont know why but it doesnt work.

  • i put it in mod/invite/start.php

    remove_menu(elgg_echo('friends'));

    and its still in my topbar menu.  any ideas?

  • i was googleing around and i think the remove_menu only works with 1.8 im using 1.7

  • coded within invite's _init function ?
    invite is at the bottom of plugins' list ?

    e.g.
            function blog_init() {
                // Load system configuration
                    global $CONFIG;
                remove_menu(elgg_echo('friends'));//:DC:
                // Set up menu for logged in users
                . . .

     

  • && i'm testing this @ 1.7.15 ;-P b/c that is duh syntax for 1.7.x ;-oO

  • Worked great thanks again.  like always you come through

     

  • So it's been a while but i found a solution to selectively remove menu items. See http://community.elgg.org/discussion/view/1078007/hide-and-delete-menu-options

    elgg_register_plugin_hook_handler('register', 'menu:site', 'myplugin_sitemenu', 1000);
    function myplugin_sitemenu($hook, $type, $return, $params) {
        if (!elgg_is_logged_in()) {
            return array();
        }
        foreach($return as $k => $v){
            switch($v->getName()){
                case "members":
                case "thewire":
                case "pages":
                case "file":
                    unset($return[$k]);
                    break;
                    
                case "groups":
                    $return[$k]->setText(elgg_echo("groups")); // Can also be used to translate menu items
                    FB::info($return[$k], "Plugin Hook");    
            }
        }
        return $return;
    }

  • @Jörn That's correct solution, but you could also use elgg_unregister_menu_item('site', 'members') on pagesetup with late priority. Sounds like natural use case for it.