Created
March 14, 2022 03:51
-
-
Save digitalchild/7a6cd60f85a5d0e2d6b530768c531231 to your computer and use it in GitHub Desktop.
Add the vendor role to an instructor when they are approved.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Required Tutor LMS v.1.6.0 | |
*/ | |
add_action('tutor_new_instructor_after', 'wcv_add_vendor_role'); | |
/** | |
* @param $instructor_id | |
* | |
* Add thhe vendor role to the user when they are approved to be an instructor. | |
*/ | |
if ( ! function_exists('wcv_add_vendor_role')){ | |
function wcv_add_vendor_role($instructor_id){ | |
$instructor = new \WP_User($instructor_id); | |
$instructor->add_role('vendor'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment