Skip to content
LearnDash

Developers

  • Filter By:

learndash_registration_form_include_course

apply_filters( 'learndash_registration_form_include_course',  boolean $include_course,  int $post_id )

Filters whether to allow user registration from the course.

Contents

  • Description
    • Parameters
    • Source
    • Examples
  • Related
    • Used By

Description #


Parameters #

$include_course

(boolean) whether to allow user registration from the course.

$post_id

(int) Course ID.


Source #

File: themes/ld30/includes/login-register-functions.php


Examples #

 <?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
);
 

Expand example code Copy to clipboard


Related #

Used By #

Used By
Used By Description
themes/ld30/includes/login-register-functions.php: learndash_validation_registration_form_course ()

Utility function to check and return the registration form course_id.

Post navigation

← Previous Hook
Next Hook →

The Most Trusted Online Course Platform for WordPress.

Get Started Demo

  • Features
  • Dynamic Learning
  • Marketing and Sales
  • Integrations
  • Course Management
  • Resources
  • Blog
  • Webinars
  • Videos
  • Case Studies
  • Add-ons
  • Online Demo
  • Company
  • About LearnDash
  • Brand Assets
  • Careers
  • Affiliates
  • Privacy Policy
  • Terms and Conditions
LearnDash LearnDash® Copyright© 2012-2021. All rights reserved.
  • Twitter
  • Facebook
  • LinkedIn
  • YouTube