Add bbPress Default Role
When integrating bbPress and WordPress and using only the WordPress registration, no default role was assigned to the user in bbPress. This will give the user a role of member in bbPress. Just activate, and whenever a user signs up, they will automatically have the bbPress role assigned. Note: this is not retroactive; it is only for new registrations.
Code
function insertbbPressRole($insert_id) {
$capability = maybe_unserialize('a:1:{s:6:"member";b:1;}');
update_usermeta($insert_id,'bb_capabilities',$capability);
}
add_action('user_register', 'insertbbPressRole');
Written while working for Matrix Group International.