Helping you Build Your Own Social Network!

Faster, better and easier!

Give a new life to your social network!

Building your own social network was never so easy. Thanks to BuddyPress, now we all can have a a social networking for what ever niche we want. It's simple easy and out of the box.

We help you to build your social network professionally. We provide a ton of plugins/themes to help you spice your network functionally and asthetically. After all, for the success of a social network, the end users experience matters and we help you to deliver that end user experience.

Sounds interesting! Check out membership details below or take a look at the faq or Why Should you join BuddyDev Premium Club

Exclusive Buddypress Plugins

Our Plugins are designed and developed keeping in mind equally You(the Site admins) and the end Users, we incorporate what you need and what your users want. Checkout a few of our popular plugins here View all plugins

Highly usable themes

We cherish our quest for the distinguished theme. Be it customization, flexibility or extendibility, or usability; Our themes are designed to handle it perfectly.Checkout a few of our themes here We love to explore the unknown and providing that ultimate experience for our users. Be it the Unified search or be it the Auto Login for site, we were the first one to implemet it. And we will continue to do so.
BuddyPress provides Social networking in a box, We help you to get that magical thing working!
More than 10,000 copies of Cosmic Buddy Theme downloaded since its first release in January 2010. We sincerely thank you all for such a huge response. A Big Thank You :)
Do you have an idea for a plugin and want it to be realized. Let us know, we will love to bring your idea to reality. Suggest a plugin here.

Recent Posts

Exclude Users from Members directory on a BuddyPress based social network

Jotted by Brajesh Singh in Buddypress, Buddypress Tricks on January 29, 2012
We are Hiring new WordPress/buddyPress developers

Hi All,

I hope you all are busy building the next awesome social network.

It has been a long time since I wrote my last post. I was busy setting up an office here in Mohali,Punjab. Everything is setup now, and I am almost back to regular work.

Today, we will see how to exclude some members from  the members directory of BuddyPress. I have seen this question numerous times  and finally I thought to put a small tutorial. It is quick and easy tutorial, so Let us begin.

We will need to hook to 'bp_ajax_querystring' filter.

The following code will allow to exclude the users from the members directory. They will be still listed in the friends list of other users with whom they are friends with.


add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
function bpdev_exclude_users($qs=false,$object=false){
 //list of users to exclude

 $excluded_user='1,2,3';//comma separated ids of users whom you want to exclude

 if($object!='members')//hide for members only
 return $qs;

 $args=wp_parse_args($qs);

 //check if we are listing friends?, do not exclude in this case
 if(!empty($args['user_id']))
 return $qs;

 if(!empty($args['exclude']))
 $args['exclude']=$args['exclude'].','.$excluded_user;
 else
 $args['exclude']=$excluded_user;

 $qs=build_query($args);

 return $qs;

}

You can put the above code in functions.php of your theme or in bp-custom.php.

Everything is fine and the users will be gone from the list. Now, comes a decision point. do you want them to be searchable ? The above code will hide them from the search too.

So, let us improve on our code .


add_action('bp_ajax_querystring','bpdev_exclude_users',20,2);
function bpdev_exclude_users($qs=false,$object=false){
 //list of users to exclude

 $excluded_user='1,2,3';//comma separated ids of users whom you want to exclude

 if($object!='members')//hide for members only
 return $qs;

 $args=wp_parse_args($qs);

 //check if we are searching  or we are listing friends?, do not exclude in this case
 if(!empty($args['user_id'])||!empty($args['search_terms']))
 return $qs;

 if(!empty($args['exclude']))
 $args['exclude']=$args['exclude'].','.$excluded_user;
 else
 $args['exclude']=$excluded_user;

 $qs=build_query($args);

 return $qs;

}

That’s it. All we are doing is checking if the query string is for listing members and we modify it to exclude the users.

I hope the code will help a couple of you.

Looking forward to hear your feedbacks :)

Get Adobe Flash playerPlugin by wpburn.com wordpress themes