apply_filters( 'learndash_login_form_include_course', boolean $include_course, int $course_id )
Filters whether to allow enrollment of course with the login. The default value is true.
Description #
Parameters #
- $include_course
-
(boolean) Whether to allow login from the course.
- $course_id
-
(int) Course ID.
Source #
Examples #
Note: Extended code example below not guaranteed, you may need to consult with a developer
<?php
/**
* Example usage for learndash_login_form_include_course filter.
*/
add_filter(
'learndash_login_form_include_course',
function( $auto_enroll = true, $course_id = 0 ) {
if ( $course_id === 123 ) {
$auto_enroll = false;
}
// Always return $auto_enroll.
return $auto_enroll;
},
10,
2
);
Changelog #
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |