In this tutorial, you’ll learn how to auto-approve instructors in Tutor LMS with a step-by-step guide using the Code Snippets plugin. No more manual approvals—make your instructor registration process seamless by automatically approving new instructors when they sign up.
Follow along to simplify your Tutor LMS instructor workflow. 🔹 What you’ll learn in this video:
- How to install and activate the Code Snippets plugin in WordPress.
- How to add custom code to auto-approve instructors in Tutor LMS.
- Step-by-step process to configure the snippet and test the auto-approval feature
By the end of this guide, you’ll have a fully automated system in place that approves instructors as soon as they register on your Tutor LMS Instructor Registration page. 🚀 Key Benefits: 1. Save time with automatic instructor approvals 2. Simplify your Tutor LMS management 3. Improve your onboarding process for new instructors
Code for Auto-Approval to Instructors
/**
* 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);
}
}
