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
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | 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. |