#5842
Vladimir
Keymaster

Hi,

May be this code will give a starting point:


if (is_multisite()) {
    add_action( 'wpmu_activate_user', 'add_secondary_role', 10, 1 );
} else {
    add_action( 'user_register', 'add_secondary_role', 10, 1 );
}

 
function add_secondary_role( $user_id ) {
 
    $user = get_user_by('id', $user_id);
    $user->add_role('custom_role_id');
 
}

I will be out of office until July 31st.