Skip to:
Content
Pages
Categories
Search
Top
Bottom

How Do I Remove Log Out From “My Account” Menu?

  • Avatar of AndroidTheater
    AndroidTheater
    Member

    @androidtheater

    I’m trying to remove the Log out from the buddypress menu bar that goes at the top of the blog (I think its called the admin bar). What would be the best way to do this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Avatar of AndroidTheater
    AndroidTheater
    Member

    @androidtheater

    yay i got it!

    Avatar of chrisreg1
    chrisreg1
    Member

    @chrisreg1

    How did you do it

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Don’t hack the core, if thats what you did. Just use the adminbar `remove_action` to delete the logout.

    in your bp-custom;

    `function remove_logout_bp_adminbar() {
    remove_action(‘bp_adminbar_menus’, ‘bp_adminbar_logout_subnav’, 6);
    }
    add_action(‘wp_footer’,’my_alter_bp_adminbar’,1);`

    Avatar of chrisreg1
    chrisreg1
    Member

    @chrisreg1

    Thanks Virtuali but the Logout menu was still there and at the bottom of the site I saw this message

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘my_alter_bp_adminbar’ was given in /home/content/62/7486962/html/wordpress/wp-includes/plugin.php on line 395

    Please advise!

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    `function remove_logout_bp_adminbar() {
    remove_action(‘bp_adminbar_menus’, ‘bp_adminbar_logout_subnav’, 6);
    }
    add_action(‘wp_footer’,’remove_logout_bp_adminbar’,1);`

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Sorry Chris, forgot to change the add_action to match it!

    `add_action(‘wp_footer’,’remove_logout_bp_adminbar’,1);`

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    First attempt sounded like you were worshiping at the high alter of the church of St BP of adminbar

    Avatar of chrisreg1
    chrisreg1
    Member

    @chrisreg1

    Hmm unfortunately, that still did not work. Thanks for all your help thus far guys. Here is how my problem originated:

    I recently transferred my site from the default ”/wordpress/” sub directory to my root directory. Everything works fine in BuddyPress except for the LOGOUT and LOGIN menu options from the BuddyPress menu bar (up at the top).

    Upon looking at the URL that the logout and login tries to redirect to (in the tag), it still thinks it is in the ”/wordpress” subdirectory and the thus results in a Error 404 – Page Not Found problem.

    I’ve search various ways to do this but people have either not have found a solution or seem to not have posted it. I originally thought I could just use the ‘Add All Nav Links to Admin Bar’ plugin (http://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/) and hide the Login and Sign Up options but unfortunately the “Log Out” still remains since it is under the ‘My Account’.

    Any help would be much appreciated, thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.