Parent & Student Access for LearnDash Filters
Support BuddyBoss Theme Registration Page #
If you are using the BuddyBoss platform with a BuddyBoss theme, you will need this custom code because the BuddyBoss platform overrides the registration page.
bp_before_registration_submit_buttons
- Use this filter to add the checkbox markup like this function add_parent_field_to_register_form already in student-parent plugin.
bp_core_signup_user
- Use this filter to change the user role to the parent from the subscriber.
bp_core_signup_after_activate
- Use this filter to keep the role parent if this bp_core_signup_user filter doesn’t work to change the role because when it activates the user in the Buddyboss platform then it activates the user as a subscriber.
Require Date of Birth #
Use this filter to require a date of birth when adding a student/child account without an email address.
if ( apply_filters( 'learndash_access_for_parents_require_date_of_birth', false ) ) : ?>
Prevent Confirmation Emails from Sending #
Use this filter to prevent confirmation emails from sending to students.
Please note: If you choose to link student emails and not send the confirmation email, you will need to manually verify the link in your database.
if ( apply_filters( 'ea_student_parent_access_send_child_confirmation_email', true ) ) {
If this is set to false the plugin will not send any confirmation emails.
WooCommerce Filter to Allow Multiple LearnDash Course Purchases #
This filter is if you are using the LearnDash WooCommerce add-on course product type.
When using the ‘course’ product from the LD WC add-on, you cannot change the quantity:
add_filter(
'woocommerce_is_sold_individually',
function( $return, $product ) {
if ( 'course' === $product->get_type() ) {
return false;
}
return $return;
}, 2, 10
);
add_filter(
'woocommerce_is_sold_individually',
function( $return, $product ) {
if ( 'course' === $product->get_type() ) {
return false;
}
return $return;
}, 2, 10
);
With the filter you can change the quantity: