Hooks & Filters Reference
All hooks use the ld_dashboard_ prefix. Hooks are available since version 7.5.0 unless noted.
Actions
Section titled “Actions”ld_dashboard_register_reports
Section titled “ld_dashboard_register_reports”Fires during init (priority 20) to allow registration of custom table reports.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$registry |
LD_Dashboard_Report_Registry |
The report registry instance |
Location: includes/reports/class-ld-dashboard-report-registry.php
Example:
add_action( 'ld_dashboard_register_reports', function( $registry ) { LD_Dashboard_Report_Registry::register( 'my-report', 'My_Custom_Report' );} );ld_dashboard_register_charts
Section titled “ld_dashboard_register_charts”Fires during init (priority 20) to allow registration of custom Chart.js charts.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$registry |
LD_Dashboard_Report_Registry |
The report registry instance |
Location: includes/reports/class-ld-dashboard-report-registry.php
Example:
add_action( 'ld_dashboard_register_charts', function( $registry ) { LD_Dashboard_Report_Registry::register( 'my-chart', 'My_Custom_Chart' );} );ld_dashboard_register_modules
Section titled “ld_dashboard_register_modules”Fires when the module registry boots, before built-in modules are initialized. Register custom modules here.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$registry |
LD_Dashboard_Module_Registry |
The module registry instance |
Location: includes/modules/class-ld-dashboard-module-registry.php
Example:
add_action( 'ld_dashboard_register_modules', function( $registry ) { $registry->register( 'my-module', 'My_Custom_Module' );} );ld_dashboard_module_loaded
Section titled “ld_dashboard_module_loaded”Fires after a module successfully boots (dependencies met and boot() called).
Parameters:
| Parameter | Type | Description |
|---|---|---|
$module |
LD_Dashboard_Module_Base |
The loaded module instance |
Location: includes/modules/class-ld-dashboard-module-base.php
Example:
add_action( 'ld_dashboard_module_loaded', function( $module ) { if ( 'zoom' === $module->get_id() ) { // Zoom is active. }} );There is also a module-specific variant: ld_dashboard_module_{module_id}_loaded.
ld_dashboard_before_modules_boot
Section titled “ld_dashboard_before_modules_boot”Fires before the module registry iterates and boots registered modules.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$registry |
LD_Dashboard_Module_Registry |
The registry instance |
ld_dashboard_modules_booted
Section titled “ld_dashboard_modules_booted”Fires after all modules have been booted.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$registry |
LD_Dashboard_Module_Registry |
The registry instance |
$modules |
array |
Array of active module instances |
ld_dashboard_email_sent
Section titled “ld_dashboard_email_sent”Fires after an email is sent via ld_dashboard_send_email().
Parameters:
| Parameter | Type | Description |
|---|---|---|
$sent |
bool |
Whether the email was sent successfully |
$template_id |
string |
Email template ID |
$to |
string |
Recipient email address |
$args |
array |
Template arguments passed to the email |
Location: includes/emails/class-ld-dashboard-email-template.php
There is also a template-specific variant: ld_dashboard_email_sent_{template_id}.
ld_dashboard_after_save
Section titled “ld_dashboard_after_save”Fires after any save handler completes. This generic hook fires for every content type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved post ID |
$form |
array |
Full sanitized form data submitted |
$meta_data |
array |
Meta data saved to the post |
$handler |
string |
Handler ID (e.g., course, lesson, quiz) |
Location: includes/save-handlers/class-ld-dashboard-save-handler-base.php
Example:
add_action( 'ld_dashboard_after_save', function( $post_id, $form, $meta_data, $handler ) { if ( 'course' === $handler ) { // Run after any course save. }}, 10, 4 );ld_dashboard_after_course_save
Section titled “ld_dashboard_after_course_save”Fires after a course is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved course post ID |
$meta_data |
array |
Meta data saved to the post |
Location: includes/save-handlers/class-ld-dashboard-save-handler-course.php
Example:
add_action( 'ld_dashboard_after_course_save', function( $post_id, $meta_data ) { // Sync course to external system.}, 10, 2 );ld_dashboard_after_lesson_save
Section titled “ld_dashboard_after_lesson_save”Fires after a lesson is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved lesson post ID |
$meta_data |
array |
Meta data saved to the post |
$course_id |
int |
Associated course ID |
Location: includes/save-handlers/class-ld-dashboard-save-handler-lesson.php
ld_dashboard_after_topic_save
Section titled “ld_dashboard_after_topic_save”Fires after a topic is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved topic post ID |
$meta_data |
array |
Meta data saved to the post |
$course_id |
int |
Associated course ID |
$lesson_id |
int |
Associated lesson ID |
Location: includes/save-handlers/class-ld-dashboard-save-handler-topic.php
Example:
add_action( 'ld_dashboard_after_topic_save', function( $post_id, $meta_data, $course_id, $lesson_id ) { // React to topic save with full hierarchy context.}, 10, 4 );ld_dashboard_after_quiz_save
Section titled “ld_dashboard_after_quiz_save”Fires after a quiz is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved quiz post ID |
$meta_data |
array |
Meta data saved to the post |
$course_id |
int |
Associated course ID |
Location: includes/save-handlers/class-ld-dashboard-save-handler-quiz.php
ld_dashboard_after_question_save
Section titled “ld_dashboard_after_question_save”Fires after a question is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved question post ID |
$meta_data |
array |
Meta data saved to the post |
$quiz_id |
int |
Associated quiz post ID |
Location: includes/save-handlers/class-ld-dashboard-save-handler-question.php
ld_dashboard_after_certificate_save
Section titled “ld_dashboard_after_certificate_save”Fires after a certificate is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved certificate post ID |
$meta_data |
array |
Meta data saved to the post |
Location: includes/save-handlers/class-ld-dashboard-save-handler-certificate.php
ld_dashboard_after_group_save
Section titled “ld_dashboard_after_group_save”Fires after a LearnDash group is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved group post ID |
$meta_data |
array |
Meta data saved to the post |
Location: includes/save-handlers/class-ld-dashboard-save-handler-group.php
ld_dashboard_after_announcement_save
Section titled “ld_dashboard_after_announcement_save”Fires after an announcement is saved via the save handler.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$post_id |
int |
Saved announcement post ID |
$meta_data |
array |
Meta data saved to the post |
$course_id |
int |
Associated course ID (0 if none or unauthorized) |
Location: includes/save-handlers/class-ld-dashboard-save-handler-announcement.php
ld_dashboard_reports_registered
Section titled “ld_dashboard_reports_registered”Fires after all built-in reports and charts are registered. Use this hook to register custom reports.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$registry |
LD_Dashboard_Report_Registry |
The report registry instance |
Location: includes/reports/index.php
Example:
add_action( 'ld_dashboard_reports_registered', function( $registry ) { LD_Dashboard_Report_Registry::register( 'my-report', 'My_Custom_Report' );} );Filters
Section titled “Filters”ld_dashboard_report_data
Section titled “ld_dashboard_report_data”Filters report row data after role-based access filtering but before the response is built. Applies to all table reports.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$data |
array |
Report data rows |
$report_id |
string |
Report identifier (e.g., quiz-results) |
$args |
array |
Query arguments used to fetch the data |
Returns: array Modified report rows.
Location: includes/reports/class-ld-dashboard-report-base.php
Example:
add_filter( 'ld_dashboard_report_data', function( $data, $report_id, $args ) { if ( 'quiz-results' === $report_id ) { // Remove rows with zero score. return array_filter( $data, fn( $row ) => $row['score'] > 0 ); } return $data;}, 10, 3 );There is also a report-specific variant: ld_dashboard_report_{report_id}_data.
ld_dashboard_registered_tabs
Section titled “ld_dashboard_registered_tabs”Filters the array of registered tab classes. Use this to add, replace, or remove tabs.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$tabs |
array |
Array of tab_id => class_name pairs |
Returns: array Modified tabs array.
Location: includes/tabs/class-ld-dashboard-tab-registry.php
Example:
add_filter( 'ld_dashboard_registered_tabs', function( $tabs ) { $tabs['gradebook'] = 'My_Gradebook_Tab'; return $tabs;} );ld_dashboard_{tab_id}_content_args
Section titled “ld_dashboard_{tab_id}_content_args”Filters WP_Query arguments before the tab executes its query. Replace the tab ID placeholder with the tab slug (e.g., lesson, quiz).
Parameters:
| Parameter | Type | Description |
|---|---|---|
$args |
array |
WP_Query arguments |
Returns: array Modified query arguments.
Location: includes/tabs/class-ld-dashboard-tab-base.php
Example:
add_filter( 'ld_dashboard_lesson_content_args', function( $args ) { $args['meta_key'] = 'featured'; $args['meta_value'] = '1'; return $args;} );ld_dashboard_{tab_id}_content
Section titled “ld_dashboard_{tab_id}_content”Filters the rendered HTML content for a tab after all items are rendered.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$content |
string |
Rendered HTML |
Returns: string Modified HTML.
ld_dashboard_email_types
Section titled “ld_dashboard_email_types”Filters the registered email type configurations. Use this to add custom email types or modify existing ones.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$email_types |
array |
Array of email type configurations |
Returns: array Modified email types.
Location: includes/emails/class-ld-dashboard-email-template.php
Example:
add_filter( 'ld_dashboard_email_types', function( $types ) { $types['my_custom_email'] = array( 'title' => __( 'My Custom Email', 'my-plugin' ), 'template' => 'custom/my-email.php', 'subject' => __( 'Hello, {user_name}', 'my-plugin' ), ); return $types;} );ld_dashboard_email_recipient_{template_id}
Section titled “ld_dashboard_email_recipient_{template_id}”Filters the recipient email address for a specific template before sending. Replace the template ID placeholder with the template ID (e.g., instructor_approved).
Parameters:
| Parameter | Type | Description |
|---|---|---|
$to |
string |
Recipient email address |
$template_id |
string |
Email template ID |
$args |
array |
Template arguments |
Returns: string Modified recipient address.
There is also a generic variant ld_dashboard_email_recipient that fires for every template (same parameters).
Location: includes/emails/class-ld-dashboard-email-template.php
Example:
add_filter( 'ld_dashboard_email_recipient_instructor_approved', function( $to, $template_id, $args ) { // Redirect approvals to a custom address in staging. if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { return 'dev@example.com'; } return $to;}, 10, 3 );ld_dashboard_email_subject_{template_id}
Section titled “ld_dashboard_email_subject_{template_id}”Filters the email subject for a specific template before sending. Replace the template ID placeholder with the template ID.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$subject |
string |
Email subject with merge tags replaced |
$template_id |
string |
Email template ID |
$args |
array |
Template arguments |
Returns: string Modified subject.
There is also a generic variant ld_dashboard_email_subject that fires for every template (same parameters).
Location: includes/emails/class-ld-dashboard-email-template.php
Example:
add_filter( 'ld_dashboard_email_subject_instructor_approved', function( $subject ) { return '[' . get_bloginfo( 'name' ) . '] ' . $subject;} );ld_dashboard_email_content_{template_id}
Section titled “ld_dashboard_email_content_{template_id}”Filters the rendered email body HTML for a specific template before the header/footer wrapper is applied. Replace the template ID placeholder with the template ID.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$content |
string |
Rendered HTML content |
$template_id |
string |
Email template ID |
$args |
array |
Template arguments |
Returns: string Modified HTML content.
There is also a generic variant ld_dashboard_email_content that fires for every template (same parameters).
Location: includes/emails/class-ld-dashboard-email-template.php
ld_dashboard_email_headers_{template_id}
Section titled “ld_dashboard_email_headers_{template_id}”Filters email headers for a specific template. Replace the template ID placeholder with the template ID.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$headers |
array |
Email headers array |
$template_id |
string |
Email template ID |
$args |
array |
Template arguments |
Returns: array Modified headers.
There is also a generic variant ld_dashboard_email_headers that fires for every template (same parameters).
Location: includes/emails/class-ld-dashboard-email-template.php
Example:
add_filter( 'ld_dashboard_email_headers_instructor_approved', function( $headers ) { $headers[] = 'CC: admin@example.com'; return $headers;} );ld_dashboard_email_merge_tags
Section titled “ld_dashboard_email_merge_tags”Filters all available merge tag values before replacement in email content and subjects.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$tags |
array |
Merge tag key-value pairs |
$content |
string |
Content being processed |
$args |
array |
Original template arguments |
Returns: array Modified merge tags.
Example:
add_filter( 'ld_dashboard_email_merge_tags', function( $tags, $content, $args ) { $tags['custom_field'] = get_option( 'my_custom_value' ); return $tags;}, 10, 3 );ld_dashboard_email_header
Section titled “ld_dashboard_email_header”Filters the HTML of the email header wrapper (output of email-header.php).
Parameters:
| Parameter | Type | Description |
|---|---|---|
$header |
string |
Email header HTML |
Returns: string Modified HTML.
ld_dashboard_email_footer
Section titled “ld_dashboard_email_footer”Filters the HTML of the email footer wrapper (output of email-footer.php).
Parameters:
| Parameter | Type | Description |
|---|---|---|
$footer |
string |
Email footer HTML |
Returns: string Modified HTML.
ld_dashboard_chart_{chart_id}_data
Section titled “ld_dashboard_chart_{chart_id}_data”Filters the complete chart response array for a specific chart.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$response |
array |
Chart response with id, chartData, options, meta |
$args |
array |
Query arguments |
Returns: array Modified chart response.
ld_dashboard_email_from_address
Section titled “ld_dashboard_email_from_address”Filters the From email address used in all plugin emails.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$from_email |
string |
From email address (defaults to WordPress admin email) |
Returns: string Modified From address.
ld_dashboard_email_from_name
Section titled “ld_dashboard_email_from_name”Filters the From name used in all plugin emails.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$from_name |
string |
From name (defaults to site name) |
Returns: string Modified From name.

