Browse: Home / Functions /

learndash_is_quiz_accessable

learndash_is_quiz_accessable( int|null $user_id = null,  WP_Post|null $post = null,  boolean $return_incomplete = false,  int $course_id )

Checks if the quiz is accessible to the user.


Description #


Parameters #

$user_id

(int|null) (Optional) $user_id Optional. The ID of User to check. Defaults to the current logged-in user.

Default value: null

$post

(WP_Post|null) (Optional) The WP_Post quiz object.

Default value: null

$return_incomplete

(boolean) (Optional) Whether to return last incomplete step.

Default value: false

$course_id

(int) (Optional) Course ID. Default 0.


Return #

(int|WP_Post|void) Returns 1 if the quiz is accessible by user otherwise 0. If the $return_incomplete parameter is set to true it may return WP_Post object for incomplete step.


Source #

File: includes/course/ld-course-progress.php


Changelog #

Changelog
Version Description
3.4.0 Introduced.