Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25295

    Please use the following code to hide the button

    
    
    /**
     * @param array $args button args.
     * @param int   $leader_id leader to be followed.
     * @param int   $follower_id follower id.
     *
     * @return mixed
     */
    function buddydev_hide_unfollow_button_for_users( $args, $leader_id, $follower_id ) {
    
    	if ( 'following' !== $args['id'] ) {
    		return $args;
    	}
    
    	// user ids who can not be unfollowed.
    	$special_user_ids = array( 1,2,3,67 );
    
    	if ( in_array( $leader_id, $special_user_ids ) ) {
    		$args['id'] = '';
    	}
    
    	return $args;
    
    }
    add_filter( 'bp_follow_get_add_follow_button', 'buddydev_hide_unfollow_button_for_users', 10, 3 );
    

    It only hides the button but does not do anything else to stop unfollowing.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295
    Brajesh Singh on in reply to: [Resolved] "Links xprofile" & NEW PLUGIN #14533

    Hi Julia,
    That was expected. Specially on the edit page. BuddyPress doe snot give any specific error on the profile edit page. That’s why I asked you to put a message in the description.

    The better and accessible way will need too much code for a simple task like this.

    2. sure, You can use any of the available javascript plugins to do that. I don’t have enough time to find a library and post the code. I will leave it upto you to find and use it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295
  • Keymaster
    (BuddyDev Team)
    Posts: 25295

    You are welcome.

  • Keymaster
    (BuddyDev Team)
    Posts: 25295

    HI Julia,
    If it is not there, please Contact your theme developers. That is the most common place to have these.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295

    Hi Julia,
    I am not sure what your questions are. Can you please help me understand them better.

    A few things that I understood, I will answer here:-

    Profile Tabs:- The navigation is managed by your theme or BuddyPress template pack. It can be vertical or horizontal based on which theme you are using. There is not much that we can do on our part.

    Reload too many time:- I am not sure what do you mean by this? Why will that be an seo issue? Is it about BuddyPress or one of our plugins?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295
    Brajesh Singh on in reply to: Types of Friends #14527

    Hi David,
    Welcome to BuddyDev.

    A. What is the criteria for redirecting users from profile to author page?
    1) A logged in user should be able to visit their own profile?
    2) Other visiting a user’s profile get redirected to author page for the displayed user?

    B. There is no such plugin available. You are looking for something like google circle. We do have a similar plugin but it is unfinished. We did it by creating custom tables for labelling Friend groups. The Labels are specific to Users.

    C. That will be very easy. If you can get the point B working, a simple pre_get_posts filter like above will do it.

    Also, BP profile Visibility or Blog Categories for Groups won’t be much help with this.

    Best Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295
    Brajesh Singh on in reply to: BuddyPress Moderation – Report Users/Groups #14526

    Thank you for the suggestions Julia. Please allow me to present it this week.

    Thank you Laurent, It’s coming this week.

    Best Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295

    You are right, that code was for older version of BuddyPress.

    Please remove that and use the following

    
    
    /**
     * Filter and remove admin and logged in users from all BuddyPress auto complete box.
     *
     * @param array $args BP_User_Query args.
     *
     * @return array
     */
    function buddydev_filter_buddypress_auto_complete_ids( $args ) {
    	$user_ids = isset( $args['exclude'] ) ? $args['exclude'] : array();
    
    	if ( $user_ids && ! is_array( $user_ids ) ) {
    		$user_ids = wp_parse_id_list( $user_ids );
    	}
    
    	$excluded = get_users( array( 'role' => 'administrator', 'fields' => 'ID' ) );
    
    	if ( is_user_logged_in() ) {
    		array_push( $excluded, get_current_user_id() );
    	}
    
    	$args['exclude'] = array_merge( $excluded, $user_ids );
    	return $args;
    }
    add_filter( 'bp_members_suggestions_query_args', 'buddydev_filter_buddypress_auto_complete_ids' );
    
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25295

    Also, Please do not post in MediaPress premium forum for non MediaPress related topics. If you are looking for premium support, It is available under “Premium Support” forum category.

    Thank you
    Brajesh