LLMS_Instructor::has_student( LLMS_Student|WP_User|int $student )

Determines if the instructor is an instructor to a specific student.


Parameters Parameters

$student

(LLMS_Student|WP_User|int) (Required) Student or user object or WP User ID.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/models/model.llms.instructor.php

	public function has_student( $student ) {

		$student = llms_get_student( $student );
		if ( ! $student ) {
			return false;
		}

		$ids = $this->get_posts(
			array(
				'posts_per_page' => -1,
			),
			'ids'
		);

		if ( ! $ids ) {
			return false;
		}

		return $student->is_enrolled( $ids, 'any' );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.34.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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