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.


Top ↑

Return Return

(bool)


Top ↑

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;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.6 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.