Auto-approving Tutor LMS Instructors

If you want to automatically approve instructors that sign up using the Instructor Registration page, use this following code in the functions.php.

This will practically allow anyone to sign up and submit courses. So please use caution while using this code.
/**
* Required Tutor LMS v.1.6.0
*/

add_action('tutor_new_instructor_after', 'approve_new_instructor_immediately');
/**
 * @param $instructor_id
 *
 * Immediately approve instructor after register
 */

if ( ! function_exists('approve_new_instructor_immediately')){
    function approve_new_instructor_immediately($instructor_id){
        update_user_meta($instructor_id, '_tutor_instructor_status', 'approved');
        update_user_meta($instructor_id, '_tutor_instructor_approved', tutor_time());

        $instructor = new \WP_User($instructor_id);
        $instructor->add_role(tutor()->instructor_role);
    }
}

Was this helpful?