{"id":29509,"date":"2010-03-25T10:45:20","date_gmt":"2010-03-25T14:45:20","guid":{"rendered":"http:\/\/wpmu.org\/?p=29509"},"modified":"2010-03-25T13:51:11","modified_gmt":"2010-03-25T17:51:11","slug":"buddypress-power-hacks","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/buddypress-power-hacks\/","title":{"rendered":"6 BuddyPress Power Hacks You Don&#8217;t Want to Miss"},"content":{"rendered":"<p>Every BuddyPress site has unique needs and the default setup may not be suitable for your community&#8217;s interaction. No need to wait until someone makes a plugin for you &#8211; just drop a little hack in and get it done yourself.<\/p>\n<p><a rel=\"lightbox[29509]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2010\/03\/tools.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-29521 aligncenter\" title=\"tools\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2010\/03\/tools-300x199.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"300\" height=\"199\" \/><\/a><\/p>\n<p>On a recent trip to the BuddyPress forums, I found a few useful hacks that may, in fact, be options that you&#8217;ve been wishing for.<\/p>\n<p>I&#8217;ve tested all of these hacks with WP 2.9.2 and BP 1.2.2.1. The ones I&#8217;ve selected are those that I think will be the most useful to the greatest number of people.<\/p>\n<p>Happy Hacking!<\/p>\n<h2>1. Display Username in Member Directory Instead of Default Member Name<\/h2>\n<p>Add this to your theme&#8217;s functions.php:<\/p>\n<pre>\/* Display Username in Directory *\/\r\nfunction my_member_username() {\r\nglobal $members_template;\r\n\r\nreturn $members_template-&gt;member-&gt;user_login;\r\n}\r\nadd_filter('bp_member_name','my_member_username');<\/pre>\n<p>Source: r-a-y at BuddyPress.org Forums<\/p>\n<h2 style=\"padding-top: 20px;\">2. Disable Required User Activation<\/h2>\n<p>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&#8217;s functions.php file:<\/p>\n<pre>function disable_validation( $user_id ) {\r\nglobal $wpdb;\r\n\r\n$wpdb-&gt;query( $wpdb-&gt;prepare( \"UPDATE $wpdb-&gt;users SET user_status = 0 WHERE ID = %d\", $user_id ) );\r\n}\r\nadd_action( 'bp_core_signup_user', 'disable_validation' );\r\n\r\nfunction fix_signup_form_validation_text() {\r\nreturn false;\r\n}\r\nadd_filter( 'bp_registration_needs_activation', 'fix_signup_form_validation_text' );<\/pre>\n<p>Source: Andy Peatling at BuddyPress.org Forums<\/p>\n<h2 style=\"padding-top: 20px;\">3. Put BuddyPress Profiles in the Root &#8211; ie. http:\/\/example.org\/username\/<\/h2>\n<p>Add this line to your wp-config.php file:<\/p>\n<p><code>define ( 'BP_ENABLE_ROOT_PROFILES', true );<\/code><\/p>\n<p>Source: BuddyPress.org: <a href=\"https:\/\/codex.buddypress.org\/getting-started\/customizing\/changing-internal-configuration-settings\/\" rel=\"noopener\" target=\"_blank\">Changing Internal Configuration Settings<\/a><\/p>\n<h2 style=\"padding-top: 20px;\">4. Change the default tab opened when looking at a user\u2019s profile (default is activity):<\/h2>\n<p>Add this line to your wp-config.php file:<\/p>\n<p><code>define( 'BP_DEFAULT_COMPONENT', 'profile' );<\/code><\/p>\n<p>Source: BuddyPress.org: <a href=\"https:\/\/codex.buddypress.org\/getting-started\/customizing\/changing-internal-configuration-settings\/\" rel=\"noopener\" target=\"_blank\">Changing Internal Configuration Settings<\/a><\/p>\n<h2 style=\"padding-top: 20px;\">5. Disable the BuddyPress Admin Bar at the top of every screen<\/h2>\n<p>Add this line to your wp-config.php file:<\/p>\n<p><code>define ( 'BP_DISABLE_ADMIN_BAR', true );<\/code><\/p>\n<p>Source: BuddyPress.org: <a href=\"https:\/\/codex.buddypress.org\/getting-started\/customizing\/changing-internal-configuration-settings\/\" rel=\"noopener\" target=\"_blank\">Changing Internal Configuration Settings<\/a><\/p>\n<h2 style=\"padding-top: 20px;\">6. Add a View BuddyPress profile link in Dashboard &gt;&gt; Users<\/h2>\n<p>Add this to your theme&#8217;s functions.php file:<\/p>\n<pre>function user_row_actions_bp_view($actions, $user_object) {\r\nglobal $bp;\r\n$actions['view'] = '&lt;a href=\"' . bp_core_get_user_domain($user_object-&gt;ID) . '\"&gt;' . __('View BP') . &lt;\/a&gt;';\r\nreturn $actions;\r\n}\r\nadd_filter('user_row_actions', 'user_row_actions_bp_view', 10, 2);<\/pre>\n<p>Source: Rich Fuller &#8211; Tutorial<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every BuddyPress site has unique needs and the default setup may not be suitable for your community&#8217;s interaction. No need to wait until someone makes a plugin for you &#8211; just drop a little hack in and get it done yourself. On a recent trip to the BuddyPress forums, I found a few useful hacks [&hellip;]<\/p>\n","protected":false},"author":4099,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[1,557,235,4,263],"tags":[],"tutorials_categories":[],"class_list":["post-29509","post","type-post","status-publish","format-standard","hentry","category-news-community","category-development","category-misc","category-plugins","category-tutorials"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/29509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=29509"}],"version-history":[{"count":8,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/29509\/revisions"}],"predecessor-version":[{"id":181464,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/29509\/revisions\/181464"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=29509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=29509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=29509"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=29509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}