Skip to:
Content
Pages
Categories
Search
Top
Bottom

Removing Visit From Admin Bar


  • stoi2m1
    Participant

    @stoi2m1

    For quite some time I had a fix for this by using the remove action for each of the buddypress admin bar components which I did not want located in the bar. The remove_action for each item was place in each themes functions.php file I have in use on a wpms/mu install.

    I recently upgraded both BP to 1.8 and WP to 3.5.2. I now have the Visit portion back in my Admin Bar only in the dashboard after the use of the below code.

    I followed the information found in the codex:
    http://codex.buddypress.org/developer/theme-development/modifying-the-buddypress-admin-bar/

    It suggested to place similar code to whats code in bp-custom.php, this fixed the issue on most of the site except removing it from the dashboard.

    function my_alter_bp_adminbar(){
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 );
    remove_action( 'bp_adminbar_menus', 'bp-adminbar-visitrandom-menu', 100 );
    //add_action('bp_adminbar_menus', 'my_adminbar_blogs_menu', 6);
    }
    add_action('wp_footer','my_alter_bp_adminbar',1);

    How can I remove it from the entire site logged in or not and on the front end of the site or within the dashbaord.

    Thank You,
    Jesse

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

  • stoi2m1
    Participant

    @stoi2m1

    A little more info…

    The issue is specific to the dashboard and its on both the main blog and sub blogs. There are two parts which I can not get removed from the dashboard. They are the Dashboard menu and the Visit menu.

    Thank You,
    Jesse


    stoi2m1
    Participant

    @stoi2m1

    BP uses an addition hook to add the bp_menus to the admin area
    add_action( 'admin_footer', 'bp_core_admin_bar' );
    i think this is missing form the codex

    To also add or remove bp_menus use the following hook
    add_action('admin_footer','my_alter_bp_adminbar');

    Good Luck,
    Jesse

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing Visit From Admin Bar’ is closed to new replies.
Skip to toolbar