Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bbPress 1.0-alpha-4 released

@dragly

Member

I’ve updated the plugin to cope with forums using blocked and inactive users as well.

function inactive_to_member() {
$userID = bb_get_current_user_info( 'id' );
$user_obj = new BP_User( $userID );
$user = bb_get_user( bb_get_user_id( $userID ) );
if(empty($user->capabilities)) {
$user_obj->set_role('member');
}
}
add_action ('bb_head', 'inactive_to_member', 5, 0);

The only flaw I can find with this plugin is that it won’t update the user’s role until the next time the user refreshes the page. I guess it could be fixed with a simple redirect/refresh in the plugin however.

Skip to toolbar