BuddyDev

Search

Replies

  • Participant
    Level: Yogi
    Posts: 1117

    Hi Brajesh, it’s working perfectly, except for ‘edit’ component,

    and for components with hyphens, ‘change-avatar’, ‘change-cover-image’. Is this because they are not part of Main Navs?

    In general, how do I add components with hyphens to a slug in an array like this one below, without getting a syntax error?

    Regards
    Carsten

      bp_core_new_nav_item( array( 
                'name' => 'Cover Image', 
                'slug' => 'change-cover-image', 
                'screen_function' => false, 
                'position' => 10,
                'parent_url'      => bp_loggedin_user_domain() . 'profile/edit/',
                'parent_slug'     => $bp->profile->slug,
                'default_subnav_slug' => 'change-cover-image',
                'show_for_displayed_user' => false,
          ) );
    }
  • Participant
    Level: Yogi
    Posts: 1117

    Hi Brajesh, thanks for your help, I’m fine with overriding the home.php, I just add the new snippet, to my child theme, not copy all the content of the home.ph, to my knowledge?

    You remember right, I used Legacy before, but switched to Nouveau some years ago.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    *Message page as well

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: [Resolved] remove settings from nav tab only #46428

    Hello Ravi, the CSS rule worked very well, thanks a lot for your help.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: [Resolved] remove settings from nav tab only #46421

    Hello Ravi, thanks for your reply. I would prefer to remove the mark up as well, but if your recommendation is to use CSS I will do that.

    I’m using nouveau template pack.

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117
    calu on in reply to: [Resolved] remove settings from nav tab only #46418

    Hi there, There are several ways out there to remove a nav item, but what is the right way?

    false

    or

    bp_core_remove_nav_item

    And which one removes only the nav tab, but not the functionality?

    In my case the Settings, which I want to display in the Main menu of my theme only, not in BP navs?

    I hope you can bring some clarification to this topic.

    Regards
    Carsten

    Solution one:

    $bp->bp_nav[‘settings’] = false; (does not work)

    Solution two:

    
    function bphelp_remove_settings_from_profile(){
    bp_core_remove_nav_item('settings');
    }
    add_action('bp_settings_setup_nav','bphelp_remove_settings_from_profile');
     
    

    Solution three inclusive Group tabs:

    
    function bpex_hide_profile_menu_tabs() {
    
    	if( bp_is_active( 'xprofile' ) ) :
    
    	if ( bp_is_user() && !is_super_admin() && !bp_is_my_profile() ) {
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_nav_item( 'activity' );
    		bp_core_remove_nav_item( 'profile' );
    		bp_core_remove_nav_item( 'friends' );
    		bp_core_remove_nav_item( 'groups' );
    	//	exist only if you use bbPress
    		bp_core_remove_nav_item( 'forums' ); 
    
    	//	BP's profile main menu items. Comment those to show.
    	//	bp_core_remove_subnav_item( 'activity', 'personnal' );
    		bp_core_remove_subnav_item( 'activity', 'mentions' );
    		bp_core_remove_subnav_item( 'activity', 'favorites' );
    		bp_core_remove_subnav_item( 'activity', 'friends' );
    		bp_core_remove_subnav_item( 'activity', 'groups' );
    	}
    	endif; 
    }
    add_action( 'bp_setup_nav', 'bpex_hide_profile_menu_tabs', 15 );
    
    function bpex_remove_group_tabs() {  
    
    	if ( ! bp_is_group() ) {
    		return;
    	}
    
    	$slug = bp_get_current_group_slug();
    
    		// hide items to all users except site admin
    	if ( !is_super_admin() ) {
    
    	//	bp_core_remove_subnav_item( $slug, 'members' );
    		bp_core_remove_subnav_item( $slug, 'send-invites' );
    	//	bp_core_remove_subnav_item( $slug, 'admin' );
    	//	bp_core_remove_subnav_item( $slug, 'forum' );
    	}
    
    }
    add_action( 'bp_actions', 'bpex_remove_group_tabs' );
    
  • Participant
    Level: Yogi
    Posts: 1117

    Yes, it’s working now, the default value were already set correctly.

    Great job Brajesh, I really appreciate your help.

    What about the updated function, will it be overwrited by the next BP update, or will this change be added next update as well?

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    Hi Brajesh, I’m glad you were able to locate the issue for me.

    I have an object cache plugin running “Object Cache 4 everyone”, I tried to deactivate it, to rule this out, an it returned the same result.
    Then I use CloudFlare cache, but this is page cache.

    Thanks for posting this issue to the BuddyPress community, and yes, you are welcome to update the BuddyPress function. Do you need access to the cPanel File Manager to do this?

    Thanks again for your big help!

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    Hi Brajesh, thanks for acknowledging the issue, you are welcome to do whatever needed on this site.

    Thanks again

    Regards
    Carsten

  • Participant
    Level: Yogi
    Posts: 1117

    Hi Brajesh, I tested with Twenty-Twenty-Two, with same result.

    Can I mail you the credentials to my site?

    Regards
    Carsten