Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile menu visibility


  • Klosurdo
    Participant

    @klosurdo

    Is there a plugin, or an easy way to hide menu items for non logged in visitors? I want to have only the “media” menu and possibly the documents icons viewable to non logged in visitors. I would like all icons viewable to only those members that are logged in.

    I am hoping there is a plugin that can do that.

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

  • danbp
    Participant

    @danbp

    Which icons are you talking about ?

    And please give details: used theme & plugins, bp version…


    Klosurdo
    Participant

    @klosurdo

    Thanks for the reply danbp,

    The Theme I am using is KLEO by Seventh Queen
    Buddy Press version Version 2.2.1

    I am looking to hide menu items for non logged in visitors in members profiles See example here.. I want to have only the “media” menu and possibly the documents icons viewable to non logged in visitors.

    I would like all icons viewable to only those members that are logged in.

    Thanks

    Other Plugins
    Akismet
    bbPress
    BuddyPress Cover Photo
    K Elements
    MOJO Marketplace
    Paid Memberships Pro
    PMPro MailChimp Integration
    PMPro Register Helper
    PMPro Set Expiration Dates
    Register Helper Example
    Revolution Slider
    rtMedia Pro for WordPress, BuddyPress and bbPress
    The Events Calendar
    WPBakery Visual Composer


    danbp
    Participant

    @danbp

    Add this to your child-theme functions.php or to bp-custom.php

    Not sure it will work with your theme, and ‘activity’ tab seems now impossible to remove (since 2.2 at least). I don’t know why exactly. Uncomment both lines to see if it works for you.

    function bpfr_hide_top_nav() {	
    	
    	if( !is_user_logged_in() ) {	
    
    // bp topnav items to hide	
    	//	bp_core_remove_nav_item( 'activity' );			
    		bp_core_remove_nav_item( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    		bp_core_remove_nav_item( 'forums' );	
    
    //bp subnav (my activities, my groups, etc)
    	//  bp_core_remove_subnav_item( 'activity', 'activity' );
    		bp_core_remove_subnav_item( 'activity', 'friends' ); 
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    	}
    }
    add_action( 'bp_ready', 'bpfr_hide_top_nav', 10 );

    Klosurdo
    Participant

    @klosurdo

    Worked wonderfully!!!!! Thanks so much! it removed everything except media and activity.


    rosyteddy
    Participant

    @rosyteddy

    Hi @danbp This is pretty cool, fun and useful.

    If bp org can add to
    About Plugins Themes Documentation **Snippets** Blog Support Download
    Snippets that actually work with WP4.1.1, and BP2.2x or BP 2.3 it will be an excellent and useful addition. Infact, users with some repu/creds can be allowed to post such snippets in this section, which can then be rated, commented or tagged. Making it a subsection of forum will make it less prominent but a tab by the side of plugins will be great.

    PS: Just curious, is there any such easy code that hides items from the left side nav bar in the site admin’s backend dashboard ?


    danbp
    Participant

    @danbp

    @rosyteddy,

    snippets published on the forum are generally related to a specific topic/question. And of course, dependant of theme and/or bp version, if not php or mysql or server settings. Over the time, they stop working or can’t be used anymore because the Core changed or because of other evolutions….

    Despite having a kind of snippet store accessible by forum menu seems to be a usefull idea, it is not. Each usage case is different and can not be extended to all case. FYI information, i had the same idea a few years back, and was quickly discouraged to do so by our Core dev. I was first disapointed, but i finally had to admit they where right. And today, i’m absolutely persuaded and on the same line.

    That’s why you have Codexes. For WP, BP or bbP with general explanation of default usage and more rarely, with usage examples. If you find a snippet example in Codex, in 95% of cases, you have to adapt it to your personnal usage.

    To answer your question, as you know, BuddyPress is (only) a WordPress plugin. When installed, the site continue to work with WordPress and WP dashboard. Nothing is modified in WP Core, only that BP was added to the site. As a plugin.

    How to handle WordPress is explained and widly documented in his Codex.
    Menu management, CPT management or how to modify menu items on Toolbar or Admin bar is also documented. And the’re so many sites giving WP tips (from excellent to awfull), you can read.


    rosyteddy
    Participant

    @rosyteddy

    Hi @danbp

    Thanks a lot.
    Is there a similar way (code that can be added like the above) to remove some items from the topmost admin/nav bar for example see the picture :


    danbp
    Participant

    @danbp

    You have to learn how to find what you need for customizing your site. I allready answered. So again, for such things, you have WP Codex (as detailled previously)
    https://codex.wordpress.org/Class_Reference/WP_Admin_Bar/add_menu


    rosyteddy
    Participant

    @rosyteddy

    hi @danbp

    Thanks.

    One problem with the above code – it seems that when items are removed from the Profile Menu, the links to same items from the top admin bar drop down leads to “Page not found error”

    Is this expected or I am doing something wrong? Thanks.


    danbp
    Participant

    @danbp

    If you remove a menu item containing a link (or whatever), how can this item be useable if it’s removed ? An item is not a page, just a link to. You’re probably wrong !


    rosyteddy
    Participant

    @rosyteddy

    Hi @danbp Thanks.
    I have posted a picture to explain what I mean:
    I thought that the code just removes the menu from the Profile menu but not the actual pages.
    Using Wp 4.1.1 and BP 2.2.1

    Thanks.


    danbp
    Participant

    @danbp

    my snippet hides buddybar items to non logged user, not BP usermenu items on Toolbar.

    To do that, you have to read the codex document i indicated in one of previous post.

    BuddyMenu is built a la BuddyPress. And you got support for this here.

    Toolbar is built a la WordPress. WP support is here.

    If you had looked a little on the forum (ie. Remove Edit My Profile), you could find this:
    https://buddypress.org/support/topic/remove-edit-my-profile/#post-150939

    And again, the one or other code doesn’t remove BP pages, only items.


    Henky
    Participant

    @henk1060

    Hello FORUM,

    Had there 2 questions.
    1.
    if I * activity * removed then the page can not be accessed.
    Is also understandable since the visit of the Members * activity * the first thing appears.

    Is it possible * activity * hide and then a message appears * for text Only for friends *?

    . 2
    can I change the sequence of the menus?
    the agency first * profile * appear and not * activity *

    thanks for your help and for my bad english,)

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.
Skip to toolbar