6 BuddyPress Power Hacks You Don’t Want to Miss

March 25, 2010  | 
34 Comments

On a recent trip to the BuddyPress forums, I found a few useful hacks that may in fact be options that you’ve been wishing for. Every BuddyPress site has unique needs and the default setup may not be suitable for your community’s interaction. No need to wait until someone makes a plugin for you – just drop a little hack in and get it done yourself. I’ve tested all of these hacks with WP 2.9.2 and BP 1.2.2.1. The ones I’ve selected are those that I think will be the most useful to the greatest number of people. Happy Hacking!

1. Display Username in Member Directory Instead of Default Member Name

Add this to your theme’s functions.php:

/* Display Username in Directory */
function my_member_username() {
	global $members_template;
	return $members_template->member->user_login;
}
add_filter('bp_member_name','my_member_username');

Source: r-a-y at BuddyPress.org Forums

2. Disable Required User Activation

This may be a built-in option to enable or disable the required activation for user accounts in future releases of BuddyPress. For now, just add this quick hack as a plugin or in your theme’s functions.php file:

function disable_validation( $user_id ) {
  global $wpdb;
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d", $user_id ) );
}
add_action( 'bp_core_signup_user', 'disable_validation' );
function fix_signup_form_validation_text() {
  return >false;
}
add_filter( 'bp_registration_needs_activation', 'fix_signup_form_validation_text' );

Source: Andy Peatling at BuddyPress.org Forums

3. Put BuddyPress Profiles in the Root – ie. http://example.org/username/

Add this line to your wp-config.php file:

define ( 'BP_ENABLE_ROOT_PROFILES', true );

Source: BuddyPress.org: Changing Internal Configuration Settings

4. Change the default tab opened when looking at a user’s profile (default is activity):

Add this line to your wp-config.php file:

define( 'BP_DEFAULT_COMPONENT', 'profile' );

Source: BuddyPress.org: Changing Internal Configuration Settings

5. Disable the BuddyPress Admin Bar at the top of every screen

Add this line to your wp-config.php file:

define ( 'BP_DISABLE_ADMIN_BAR', true );

Source: BuddyPress.org: Changing Internal Configuration Settings

6. Add a View BuddyPress profile link in Dashboard >> Users

Add this to your theme’s functions.php file:

function user_row_actions_bp_view($actions, $user_object) {

global $bp;
$actions['view'] = '<a href="' . bp_core_get_user_domain($user_object->ID) . '">' . __('View BP') . '</a>';

return $actions;
}
add_filter('user_row_actions', 'user_row_actions_bp_view', 10, 2);

Source: Rich Fuller – Tutorial

Featured Plugin - Every great SEO tweak you need, in one snazzy bundle

Fully integrated with the SEOMoz API, complete with automatic links, sitemaps and SEO optimization of your WordPress setup - this is the only plugin you need to help you rank your site number 1 on Google - nothing else compares.
Find out more

Featured Plugin - Add bottom corner (or anywhere else) chat to your site

No javascript required, no third part chat engine, just fully featured chat right in your own database on your own WP sites - couldn't be easier.
Find out more

Featured Plugin - Start Your Own Powerful Membership Site

If you're thinking about starting a paid, or just private, membership site then this is truly the plugin you've been looking for. Easy to use, massively configurable and ready to go out of the box!
Find out more

Featured Plugin - Host sites, get paid, just like WordPress.com

If you've ever wondered how you could offer a paid site management and hosting service, then this is the plugin for you. Offer a freemium or paid service, for any niche you like, it's powered Edublogs.org to success already!
Find out more

Featured Plugin - Start your own Quora / StackOverflow / Yahoo Q&A site

It's now incredibly easy to start your own Q&A site using nothing more than WordPress - The Q&A plugin simply and brilliantly transforms any site, or page, into a perfect support or Q&A environment.
Find out more

Featured Plugin - Send beautiful html email newsletters, from WordPress!

Now there's no need to pay for a third party service to sign up, manage and send beautiful email newsletters to your subscriber base - this plugin has got the lot.
Find out more

Featured Plugin - Open an Online Store with MarketPress

Out of all the WordPress ecommerce plugins available, this has got to be the winner - easy to configure, powerful functionality, multiple gateways and more. A simply brilliant plugin!
Find out more

Featured Plugin - Turn any WordPress page into a fully featured wiki!

To get a wiki up and running you used to need to install Mediawiki and toil away for days configuring it... not any more! This plugin gives you *all* the functionality you want from a wiki, in WordPress!!!
Find out more

Featured Plugin - WordPress + Google Maps = Perfect

Simply insert google maps into posts, sidebars and pages - show directions, streetview, provide image overlays and do it all from a simple button and comprehensive widget.
Find out more

34 Responses to 6 BuddyPress Power Hacks You Don’t Want to Miss

  1. This are really good hacks! Shure I’ll use some of them in my buddypress installation. Thanks, great article!

  2. thanks for the mention again :-)

    also note for BP 1.2.3 that you can filter `bp_core_signup_send_activation_key` to false to disable the email as well (otherwise that may confuse new sign ups)

  3. Pingback: wpmuorg: WPMU News: 6 Bud… « satuwp

  4. when using hack number 2 i get an error with this line:

    return > false;

    anybody else who have this? is there an error in the code?

  5. I didn’t get any errors when I used it. Sometimes when you paste from the blog to your code it can mess up the way the single tick quotes display ‘ You don’t want curly quotes, if that helps. Also, depends on where you pasted it in your function file.

  6. when i removed the : > in this line it wordked:

    return > false;

  7. It should be:


    function fix_signup_form_validation_text() {
    return false;
    }

    The “>” is a syntax error.

  8. Wow Sarah! #3 makes it easy for bp site members to spread the link love. Thanks for the tips.

  9. Pingback: Mes bookmarks du 28.03.2010

  10. Pingback: L’hebdo WordPress : WordPress 3.0 – BuddyPress – Gravatar | WordPress Francophone

  11. Pingback: L’hebdo WordPress : WordPress 3.0 – BuddyPress – Gravatar

  12. Thanks a lot for this helpful hacks!

    Maybe you can tell me how to modify the BuddyPress groups so that only an administrator can create groups?
    I would like to build up a network with just a few groups with group forums.

  13. That’s great! Thanks a lot!

  14. Sarah,
    I like the code to disable the email activation requirement, but looking at the code, that seems like it will only work with a regular WP. Have you tested it with WPMU?

  15. John Lynn – You’re right – I think it only works with regular WP, but you might try installing this plugin: http://www.thinkinginwordpress.com/2009/10/autoactivate-users-and-blogs-at-buddypress-signup/
    I’m using that on a WPMU 2.9.2 site with BP 1.2.3 and it works.

  16. I’ll check it out. I’d seen this plugin before, but it said that it wasn’t currently working at the top. Since you say it is with the latest, I’ll give it a whirl. If nothing else, I’ll check the code and see if I can’t build on top of it. Maybe integrate it to work with either WPMU and WP

  17. Ok, I just tried it and it seems to be working for me. I have the same versions as you. However, it’s still sending the activation email. Did you find a way to stop the activation email from sending?

  18. John Lynn – No, I just edited the email so that it doesn’t send the activation code but instead sends a welcome email.

  19. Where did you edit the email? Did you do that in the core somewhere?

  20. Yeah it’s a core hack but I don’t remember how I did it. Will look and try to let you know.

  21. Thanks Sarah. That’s gets me closer and helped me find it. Although, that link seems to stop the blog email notification and not the user notification. Plus, I’m hoping to do it with a plugin instead of changing the core. I know it’s possible, because there’s this premium plugin: http://buddydev.com/plugins/buddypress-premium-plugins/plugin-bp-auto-activate-auto-login-redirect-to-profile-automatically-activate-your-new-user-signuplog-them-in-and-redirect-to-their-buddypress-profile-on-signup/ I just prefer to not pay for premium plugins if possible. Plus, the code is so close to working.

    I’m guessing on the plugin you’re using, it’s trying to disable the email notification, but there’s something wrong with the order that it’s removing it or something.

  22. Sarah,

    This must one of hte most useful tips posts for buddypress i’ve ever run into, thank you. It answered 4 questions for me :)

    John Lynn,

    I use this plugin:
    http://byotos.com/plugins/welcome-pack/

    In addition to its cool features, It allows you to edit system generated emails, so you can do like Sarah and remove the activation variable from the “signup validation” email and make it a welcome email instead.

    Cheers.

  23. Pingback: VentureMaker on "Members URL slugs" « Test Blog

  24. these are good tips for buddypress. Thanks for the hacks, I gonna use it too!

  25. Thank you very much. I just got what i needed.

  26. Thank you for those hacks, just to say, instead of write all those hacks in wp_config.php, you should prefer to put them in /wp-content/plugins/bp-custom.php
    That’s much better in case you upgrade your WordPress system.

  27. Sarah,

    These are awesome hacks and really answer some of things we’ve been trying to do for the user profiles on our site. However, we run on the Genesis theme, which uses a different format for their functions.php. Do you have any advice for how I would transfer some of this over to fit within their parameters?

    Thank you,
    Shane

  28. Very very very very nice!!!

    Thanks!

  29. I am using xProfiles ACL for my BuddyPress site. I have a base field group and a few other field groups. The base field group should be visible to all ‘subscribers’. The rest of the field groups should only be visible by one particular role. So, i set it up accordingly.

    What I think is a bit strange, is that the user isn’t able to edit his own details in field groups other than ‘Base’.

    I know it is because default user role to my site is ‘Subscriber’, but i think it should be enabled for a user to always be able to edit his own profile details.

    can anybody help me out on this? I will be grateful. Thank you :)

  30. Very much useful buddypress tutorials thanks for sharing this with us

  31. I cant get number six to work. I pated it in bottom of functions.php. Any advice?

  32. Hi,

    Is it all possible to change the role types that appear in the member directory. Say for example if I only wanted those that were at Contributer Level shown and those at subscriber level hidden?

    David

Click on a tab to select how you'd like to leave your comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting