apply_filters( 'learndash_registration_form_include_course', boolean $include_course, int $post_id )
Filters whether to allow user registration from the course.
Description #
Parameters #
- $include_course
-
(boolean) whether to allow user registration from the course.
- $post_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_registration_form_include_course filter. */ add_filter( 'learndash_registration_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. |