Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Remove the ”DashBoard” from the adminbar (17 posts)

Started 1 year, 5 months ago by: Dale Baker

  • Profile picture of Dale Baker Dale Baker said 1 year, 5 months ago:

    I just upgraded the newest version of BP and need some serious help in removing the “DashBoard” section from the adminbar. Can any one please help me?

  • Profile picture of @mercime @mercime said 1 year, 4 months ago:

    If you don’t have one yet, create a bp-custom.php file and`add this:

    <?php 
    
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu',  6   );
    
    ?>
  • Profile picture of Hugo Hugo said 1 year, 4 months ago:

    As puzzled over in another similar thread request what is the issue with this addition. Wish people would describe there setup and reasons for serious requests then perhaps we could look for better overall solutions rather than simply hack at things!

  • Profile picture of BigStupidWillis BigStupidWillis said 1 year, 4 months ago:

    These are the lines in ‘bp-core-adminbar.php’ that add the new menu items:
    (wp-content>plugins>buddypress>bp-core>bp-core-adminbar.php)

    add_action( ‘bp_adminbar_menus’, ‘bp_adminbar_blogs_menu’, 6 );
    add_action( ‘bp_adminbar_menus’, ‘bp_adminbar_thisblog_menu’, 6 );

    add_action( ‘bp_adminbar_menus’, ‘bp_adminbar_authors_menu’, 12 );

    You can ‘remove_action’ as mentioned above or simply delete the lines of the menu items you don’t want. The plugin “Add All Nav Links to BP Adminbar” is a nice plugin with options for modifying the admin bar. (It doesn’t have options for the new ‘dashboard’ menu but I’m sure it will on the next update.)

    Word.

  • Profile picture of Boone Gorges Boone Gorges said 1 year, 4 months ago:

    mercime’s solution should work nicely.

    Keep in mind that the Dashboard option only appears for logged-in users who have a role greater than Subscriber on your blog.

  • Profile picture of Virtuali Virtuali said 1 year, 4 months ago:

    @mercime, remember if you put this in bp-custom.php you need to remove the beginning php tag, and the end tag because it will cause a parse error: unexpected “<" error.

  • Profile picture of pcwriter pcwriter said 1 year, 4 months ago:

    @bigstupidwillis

    If you have any other suggestions for the plugin, please let me know here:

    http://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/forum/topic/what-would-you-like-to-see-in-the-next-update/

  • Profile picture of @mercime @mercime said 1 year, 4 months ago:

    @gunju2221 you need to have the opening <?php and closing ?> to surround code especially if you just created a new bp-custom.php. The parse error you mentioned may have been caused by something else.

  • Profile picture of Virtuali Virtuali said 1 year, 4 months ago:

    @mercime The tags are not needed in bp-custom.php because “unexpected “<" is referring to the tags, "unexpected" means there is an error in the code of where of it simply shouldn't be there. (tested, removed tags solved parse error)

    Maybe I have the special bp-custom.php, but from my understanding you only need opening tags is of when you are creating or calling a brand new function, otherwise being split up in the file by a "}"

    I could be wrong, but this is how I make php work.

  • Profile picture of Dia Ritoch Dia Ritoch said 1 year, 4 months ago:

    I don’t know if it’s proper but I only edited my CSS file and added

    li#bp-adminbar-thisblog-menu {display:none;}

    and that did the trick!

  • Profile picture of Hugo Hugo said 1 year, 4 months ago:

    @gunju2221 thing is Savanah Mercime is pretty experienced with BP and no doubt even more experienced with PHP :)

    For the php parsing engine to work you must have php tags around your script elements, common practice is to open and close those tags when needing to parse markup, or one adds one opening and one closing set and all markup in the script needs to be set as echoed strings, variables or the heredoc function called.

    Likely you have a file that is using supplied snippets written by members and which for potability each have their own set of tags.

  • Profile picture of Virtuali Virtuali said 1 year, 4 months ago:

    Oh, mercime is far ahead of the game, I am just trying to figure out why the tags arn’t needed for me, as I know they are always needed.

  • Profile picture of Dia Ritoch Dia Ritoch said 1 year, 4 months ago:

    mercime’s code worked.
    @Boones George: “Keep in mind that the Dashboard option only appears for logged-in users who have a role greater than Subscriber on your blog.”

    — I am using One Quick post for front end posting coz I dont allow members/editors/authors to access the backend. They have higher roles, therefore they can see the dashboard from the BP Admin bar. My question now is, is there a code for roles higher than subscriber not to see the Dashboard link?

  • Profile picture of dude dude said 6 months, 1 week ago:
    <?php 
    
    remove_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu',  6   );
    
    ?>

    didn’t work for me for some reason..? I thought it might be clashing with the dashboard commander plugin so tried de-activating that plugin to no avail :(

    tried as suggested in a bp-custom.php in my bp-default child theme

  • Profile picture of aces aces said 6 months, 1 week ago:

    bp-custom.php goes into the plugins folder immediately under /wp-content/plugins/ not in a theme folder/directory….