LLMS_REST_Instructors_Controller::is_instructor( int $user_id )
Determine if a given user has an instructor role.
Parameters Parameters
- $user_id
-
(int) (Required) WP_User id.
Return Return
(bool)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-instructors-controller.php
protected function is_instructor( $user_id ) {
$user = get_userdata( $user_id );
return $user ? (bool) array_intersect( $this->get_instructor_roles(), (array) $user->roles ) : false;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 1.0.6 | Introduced. |