BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 28

    Ravi,
    That works perfectly.
    And is exactly what I wanted to achieve.
    I appreciate your help very much indeed.
    Thankyou sir!

  • Participant
    Level: Enlightened
    Posts: 28

    I tried changing the above to:

    
    if ( bp_is_members_directory() || bp_is_friends_component() )
    

    which does hide the Add Friend buttons in the user’s Friends list (which I want), but also unfortunately hides the Add Friend button at the top of the profile (which I don’t want).

    Could this be improved on?

    Thankyou!

    • This reply was modified 2 years, 7 months ago by Michael.
    • This reply was modified 2 years, 7 months ago by Michael.
  • Participant
    Level: Enlightened
    Posts: 28

    Thanks Ravi,

    – Add Friend/Private Message buttons are hidden on profile page using “BP Registration Options” plugin, for new members only, once ‘approved’ those buttons become visible to the user.

    – Add Friend button is hidden on members page (for all users) using code snippet:

     /**
     * Hide "Add Friend" button on members list & search results list
     */
    add_filter( 'bp_get_add_friend_button', function ( $button ) {
    
    	if ( bp_is_members_directory() ) {
    		$button = array();
    	}
    
    	return $button;
    } ); 

    – So I need the similar functionality as the snippet above; simply hide the Add Friend buttons in the Friends list (for all users), but the friends feature is not disabled.

    Thanks!

  • Participant
    Level: Enlightened
    Posts: 28

    Sorry, this post should be in Buddypress not Themes.