it would be code-able, but I don’t know of anything that does this already
not tested, but the following in your functions file should do it
you’ll need to edit the code for which role does what
add_action('wp_login', 'rew_assign_role_on_login', 10, 2);
//this function assigns user to bbp roles on login
function rew_assign_role_on_login($user_login, $user) {
$user_id = $user->ID ;
$role = get_role($use_id) ;
if (empty ($role)) return ; //has no role in the database
if ($role == 'administrator' ) $new_role = 'bbp_keymaster' ;
if ($role == 'editor' ) $new_role = 'bbp_moderator' ;
if ($role == 'author' ) $new_role = 'bbp_moderator' ;
if ($role == 'contributor' ) $new_role = 'bbp_participant' ;
if ($role == 'visitor' ) $new_role = 'bbp_blocked' ;
if ($role == 'subscriber' ) $new_role = 'bbp_spectator' ;
bbp_set_user_role( $user_id, $new_role)
}
I say edit Robin’s code and change
if ($role == 'subscriber' ) $new_role = 'bbp_spectator' ;
To this.
if ($role == 'subscriber' ) $new_role = 'bbp_participant' ;
And in my opinion you should not auto-assign moderators and just manually update the users roles for each of the users you trust to moderate the forums. Also I am not sure there is a visitor WordPress role.
https://codex.wordpress.org/Roles_and_Capabilities#Summary_of_Roles
Also I am not sure there is a visitor WordPress role.
oops… no there isn’t – old code left on my test site !
and who gets what were just examples 🙂
Thank you both very much – I am testing this out right now!
great – to help others please post back your solution if successful, or come back for further help !
I’ve tried @robin-w snippit above but didnt work with my current wordpress version(latest one according to the date of my post) but i managed to get it working with this snippit if anyone needs it.
Note: I’m a beginner to wordpress and bbpress so there might be other better ways of doing this.
function change_role(){
$user_id = $user->ID ;
if( current_user_can(‘administrator’)){
bbp_set_user_role( $user_id, ‘bbp_keymaster’ );
}
}
add_action(‘wp_login’, ‘change_role’);