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.
Return Return
(bool)
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' ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.34.0 | Introduced. |