ulgm_groups_management_send_emails_group_user_course_statuses
Filters the available course status options for sending group emails to users.
add_filter( 'ulgm_groups_management_send_emails_group_user_course_statuses', $callback, 10, 1 );
Description
Filters the available course status options displayed in the group user course status report. Developers can use this to add custom statuses or modify existing ones for a more granular reporting experience. The hook provides an array of status keys and their translated labels.
Usage
add_filter( 'ulgm_groups_management_send_emails_group_user_course_statuses', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
/**
* Example of modifying the course statuses available for email notifications.
*
* This filter allows you to add or remove course status options that can be selected
* when sending email notifications to group users based on their course progress.
* For instance, you might want to add a custom status like 'on-hold' if your
* LMS or custom functionality supports it.
*/
add_filter(
'ulgm_groups_management_send_emails_group_user_course_statuses',
function ( $course_statuses ) {
// Add a custom course status for users who have paused their course.
$course_statuses['on-hold'] = __( 'On Hold', 'your-text-domain' );
// Optionally, you could remove a default status if it's not relevant.
// For example, if 'not-enrolled' is never used in this specific context:
// unset( $course_statuses['not-enrolled'] );
return $course_statuses;
},
10, // Priority: 10 is the default, adjust if needed.
1 // Accepted arguments: The filter passes one argument: the array of statuses.
);
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/classes/group-management/group-management-interface.php:580
$progress_management_report_button = Utilities::show_section( $attributes['progress_management_report_button'] );
$quiz_report_button = Utilities::show_section( $attributes['quiz_report_button'] );
$assignment_button = Utilities::show_section( $attributes['assignments_button'] );
$essay_button = Utilities::show_section( $attributes['essays_button'] );
$csv_export_button = Utilities::show_section( $attributes['csv_export_button'] );
$excel_export_button = Utilities::show_section( $attributes['excel_export_button'] );
$send_email_course_statuses = apply_filters(
'ulgm_groups_management_send_emails_group_user_course_statuses',
array(
'not-enrolled' => __( 'Not Enrolled', 'learndash' ),
'not-started' => __( 'Not Started', 'learndash' ),
'in-progress' => __( 'In Progress', 'learndash' ),
'completed' => __( 'Completed', 'learndash' ),
)