BuddyPress: hook to add new profile fields and groups

Well seems like not many people are digging into BP so here is the solution I found. To add a new field group using BP hooks: // Create new Field Group $group_args = array( ‘name’ => ‘Social Networks’ ); $group_id = xprofile_insert_field_group( $group_args ); // group’s ID To add some fields to this new group: … Read more

How do I set up real anonymous posting in bbpress forums? [closed]

When we post an empty anonymous reply, we get the following errors: The part of BBPress that’s responsible for handling this, is the bbp_new_reply_handler() function, in the file /bbpress/includes/replies/functions.php. It contains these lines that are of interest to us: // User is anonymous if ( bbp_is_anonymous() ) { // Filter anonymous data $anonymous_data = bbp_filter_anonymous_post_data(); … Read more

How to display random users with avatars

I am not sure why your query is returning more IDs than necessary. The $args for get_users look correct. By default get_users does not support orderby=rand, but you can overwrite that option. See below: function random_user_query( &$query ) { $query->query_orderby = “ORDER BY RAND()”; } // Usage: [random_users how_many = 3] add_shortcode( ‘random_users’, ‘display_random_users’ ); … Read more

BuddyPress: Adding a new tab in groups

There’s an example of this on the buddypress forums which is a good place to start looking for answers. http://buddypress.org/community/groups/creating-extending/forum/topic/can-someone-explain-how-to-add-tabs-to-the-profile-page/ For the sake of answering here though here goes: bp_core_new_subnav_item( array( ‘name’ => ‘My Group Page’, ‘slug’ => ‘my-group-page’, ‘parent_url’ => $bp->loggedin_user->domain . $bp->groups->slug . “https://wordpress.stackexchange.com/”, ‘parent_slug’ => $bp->groups->slug, ‘screen_function’ => ‘my_groups_page_function_to_show_screen’, ‘position’ => 40 … Read more

Add BuddyPress Profile Menu Item [closed]

Here’s an example of adding a menu items pointing to custom templates. If you want to link to existing BP elements, you’ll need to look up the appropriate action. Add this to functions.php: // Set up Cutsom BP navigation function my_setup_nav() { global $bp; bp_core_new_nav_item( array( ‘name’ => __( ‘Item One’, ‘buddypress’ ), ‘slug’ => … Read more