1. Home
  2. Knowledge Base
  3. Uncanny Groups for LearnDash
  4. Actions/Filters for Developers
Uncanny LearnDash Groups provides the hooks below for advanced developers to use when developing custom functionality that integrates with the plugin.  No support is provided for the use of these filters.

Outputting the list of courses on the Group Management page
$post_vars = array(
 	'post_type'     => 'sfwd-courses',
 	'meta_key'      => 'learndash_group_enrolled_' . $group_id,
 	'post_per_page' => - 1,
 	'numberposts'   => - 1
);
$post_vars = apply_filters( 'ulgm_group_courses_list_get_posts_vars', $post_vars, $group_id);
$courses = get_posts( $post_vars );
$courses = apply_filters( 'ulgm_group_courses_list_courses', $courses, $post_vars, $group_id);
When an existing user is added on front end
do_action( 'ulgm_existing_group_user_added', $user_data, $group_id, $order_id );
$do_not_send_emails = apply_filters( 'ulgm_do_not_send_existing_user_email', $do_not_send_emails, $user_data, $group_id, $order_id );
Before user is added on front end
//returns true or false if group leader allowed to add user
//wp_get_current_user() = (object) of current logged in user details 
//$group_email_data['group_id'] = (int) LD Group ID 
//$user_data = (object) user data, user_email is part of the array and recommended method to verify user v/s group leader
$ulgm_gdpr_compliance = apply_filters( 'ulgm_gdpr_is_group_leader_allowed', true, wp_get_current_user(), (int) $group_email_data['group_id'], $user_data );
After user is added on front end
do_action( 'ulgm_group_user_invited', $user_data, $group_id, $order_id );
$do_not_send_emails = apply_filters( 'ulgm_do_not_send_new_user_email', $do_not_send_emails, $user_data, $group_id, $order_id );
When redemption email is sent out
do_action( 'ulgm_redemption_email_sent', $user_data, $group_id );
$do_not_send_emails = apply_filters( 'ulgm_do_not_send_redemption_email', $do_not_send_emails, $user_data, $group_id );
When group leader is added on front end
do_action( 'ulgm_group_leader_added', $user_data, (int) $_POST['group-id'], $order_id );
When group leader is removed on front end
do_action( 'ulgm_group_leader_removed', $user_id, (int) $group_id );
When user is removed on front end
do_action( 'ulgm_group_user_removed', $user_id, (int) $group_id );
Email filters
$to      = apply_filters( 'ulgm_redemption_email_to', $user_email, $user_data, $group_id );
$subject = apply_filters( 'ulgm_redemption_email_subject', $redemption_template_subject, $user_data, $group_id );
$body    = apply_filters( 'ulgm_redemption_email_body', $redemption_template_body, $user_data, $group_id );
$to      = apply_filters( 'ulgm_welcome_email_to', $user_email, $user_data, $group_name );
$subject = apply_filters( 'ulgm_welcome_email_subject', $welcome_template_subject, $user_data, $group_name );
$body    = apply_filters( 'ulgm_welcome_email_body', $welcome_template_body
//For emails sent with "Email Users" button
$mail_args['subject'] = apply_filters( 'ld_group_email_users_personalize_subject', $mail_args['subject'], $user_data, $group_email_data );
$mail_args['message'] = apply_filters( 'ld_group_email_users_personalize_message', $mail_args['message'], $user_data, $group_email_data );

Was this article helpful?

0 replies

Comments/Questions

Please note that this is not an official support channel and questions/comments may go unanswered.
To request support, log in to your account and click Submit a Request.

Leave a Reply

Your email address will not be published. Required fields are marked *