Skip to:
Content
Pages
Categories
Search
Top
Bottom

Remove Buddypress Admin Bar

  • Avatar of AJ
    AJ
    Participant

    @permaculturetreegeek

    I would like to entirely remove the Buddypress admin stuff from the admin bar.

    WP: 3.8
    BP: 1.9.1

    I don’t want to use css – display: none;

    I have tried:

    bp-custom.php in Theme Folder and Plugin Folder.

    <?php
    define( ‘BP_DISABLE_ADMIN_BAR’, true );
    ?>

    In the theme folder it does nothing.
    In the plugin folder it gives this ERROR: Use of undefined constant ‘BP_DISABLE_ADMIN_BAR’ – assumed ‘‘BP_DISABLE_ADMIN_BAR’’ in /wp-content/plugins/bp-custom.php

    also:

    In functions.php:
    add_filter(‘show_admin_bar’, ‘__return_false’);

    this gives the ERROR: Notice: Use of undefined constant ‘show_admin_bar’ – assumed ‘‘show_admin_bar’’ /themes/twentyfourteen/functions.php on line 526

    … and the buddypress docs page for Hiding the Admin Bar is gone! http://codex.buddypress.org/how-to-guides/modifying-the-buddypress-admin-bar/hiding-the-buddypress-admin-bar/

    Anyone know how to remove the buddypress admin menu links from the admin bar?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Henry
    Henry
    Participant

    @henrywright-1

    add_filter(‘show_admin_bar’, ‘__return_false’);

    In that code your '‘s look wonky.

    Try

    add_filter( 'show_admin_bar', '__return_false', 99 );

    I’ve also put a high priority on it to make sure it gets done ( a priority of 99 ).

    Avatar of AJ
    AJ
    Participant

    @permaculturetreegeek

    @henry & @Barney – cool… both of those work to get rid of the whole admin bar.

    However, I would like to end up with this:

    If (the user is author) { get rid of all the Buddypress stuff in the admin bar}, else {get rid of the whole admin bar.}

    Like this:

    if ( current_user_can( 'publish_posts' ) ) {
        get rid of all Buddypress stuff in admin bar
    } else {
       add_filter( 'show_admin_bar', '__return_false', 99 );
    }

    My ‘s were wonky in this also:

    define( 'BP_DISABLE_ADMIN_BAR', true );

    No errors, however it still doesn’t work.

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

You must be logged in to reply to this topic.