Filter: sensei_is_enrolled

apply_filters( 'sensei_is_enrolled', $is_enrolled, $user_id, $course_id, $check_cache ) → {bool|null}

Allow complete side-stepping of enrolment handling in Sensei.

This will have some other side-effects. For example, if using learner queries (My Courses, Learner Profiles, etc), you will have to save the learner term and association by using the \Sensei_Course_Enrolment::save_enrolment method. Additionally, manual enrolment handling in Learner Management will not have any effect.

Parameters:
Name Type Description
$is_enrolled bool | null

If a boolean, that value will be used. Null values will keep default behavior.

$user_id int

User ID.

$course_id int

Course post ID.

$check_cache bool

Advise hooked method if cached values should be trusted.

Since:
  • 3.0.0
Source:
Returns:

Filtered value.

Type
bool | null