wordpress functions.php set user role code example
Example: update user role wordpress
$wp_user_object = new WP_User($current_user->ID);
$wp_user_object->set_role('editor');
$wp_user_object = new WP_User($current_user->ID);
$wp_user_object->set_role('editor');