Group Mods

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

Remove ”Visit” from the admin bar (14 posts)

Started 1 year, 7 months ago by: we-are-chesapeake

  • Profile picture of we-are-chesapeake David Abbott said 1 year, 7 months ago:

    Hi all. I’m trying to remove the “Visit” drop down menu in the admin bar, but removing the action in bp-custom.php doesn’t seem to be doing the trick. I’ve tried:

    remove_action( ‘bp_adminbar_menus’, ‘bp_adminbar_random_menu’, 100 );

    And a number of other things to no avail. Can anyone help?

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 7 months ago:

    well bp-custom.php is loaded before the adminbar – so place the remove_action in your theme’s function.php file

  • Profile picture of moosh101 moosh101 said 1 year, 7 months ago:

    Hi,

    You can remove the Visit random user/group by removing the links in the bp-core-adminbar.php file, found in /wp-content/plugins/buddypress/bp-core/ Its best to remove the lines of code:

    <a href="root_domain . ‘/’ . BP_MEMBERS_SLUG . ‘/?random-member’ ?>”>

    <a href="root_domain . ‘/’ . $bp->groups->slug . ‘/?random-group’ ?>”>

    <a href="root_domain . ‘/’ . $bp->blogs->slug . ‘/?random-blog’ ?>”>

    This code appears between lines 221-237. Leave the opening function in place, just remove the code between, and including, the and . Save the file, reload the page and the visit links should now be gone.

    All the best,

    Shane.

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 7 months ago:

    use the remove_action – it works – modifying the core files will only be wiped out upon your next update (unless you tediously merge each file)

  • Profile picture of we-are-chesapeake David Abbott said 1 year, 7 months ago:

    Thank you both. I’ll try removing the action in functions.php and get back.

    How does one go about finding out the order in which files are loaded?

  • Profile picture of rich! @ etiviti rich! @ etiviti said 1 year, 7 months ago:

    just by looking at the source code (in this case open up bp-core.php and you’ll see where bp-custom.php is referenced prior to the adminbar code) + another great plugin if you have a development setup -> http://wordpress.org/extend/plugins/wordpress-hook-sniffer/

  • Profile picture of we-are-chesapeake David Abbott said 1 year, 7 months ago:

    Just got around to doing it. Worked like a charm! Thanks so much

  • Profile picture of Rajwant Rajwant said 1 year, 6 months ago:

    This worked for me but on ….

    line 443 and 451 in bp-core-adminbar.php file.

  • Profile picture of Beck B Beck B said 1 year, 6 months ago:

    I was going to do the remove thing, too–so thank you all for the tips–but then I decided I might as well just hide the admin bar from logged out users, as that was my bigger concern with the random visit.anyway. (I don’t think it’ll be especially useful, and our groups are mainly private, but I don’t have any other plans for the top right portion of the screen, so…might as well leave it for now.)

  • Profile picture of Adam Adam said 1 year, 6 months ago:

    There is a much simpler, elegant solution to this problem that does not involve messing with the core code.

    Use a custom CSS plug-in so you can add your own CSS edits (you should have this anyways) and paste the following line:
    #bp-adminbar-visitrandom-menu {display:none;}

    I like this solution much better, maybe because I am not technical enough to do the function remove method.

    Adam
    stargazerinteractive.com

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

    @pcwriter ‘s Add All Nav Links to BP Adminbar plugin has an option to do this with just click of a button.
    There are many more configuration options to customise your admin bar.

    http://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/

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

    There’s also a newer, beta version of my plugin available for download with many more configuration options right in the admin panel. See this post for more:

    http://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/forum/topic/testers-needed-for-version-2-1beta/#post-69288

  • Profile picture of invisibleland invisibleland said 1 year, 1 month ago:

    I got this to work PERFECTLY by pasting it in my theme’s “functions.php” file:

    remove_action( "bp_adminbar_menus", "bp_adminbar_random_menu", 100 );

    (NOTE: this was mentioned earlier but had single-quotes rather than double-quotes, which didn’t work for me)

    PS. The Add All Nav Links to BP Adminbar plugin (or I-have-an-unnecessarily-long-ass-name plugin) removed other links from my page, so that didn’t help.

  • Profile picture of pcwriter pcwriter said 1 year, 1 month ago:

    @invisibleland

    Did you check the feature options for the plugin under ‘Settings’ > ‘BP-WP-Navbar’?
    It can be set to remove only the random menu, without modifying anything else.

    BTW, I agree that the plugin does have a long-ass-name but, as long as it does what it says it does, does it really matter?