Hooks & Filters Reference

Get Started

Hooks & Filters Reference

All hooks use the ld<em>dashboard</em> prefix. Hooks are available since version 7.5.0 unless noted.


Actions

ld<em>dashboard</em>register_reports

Fires during init (priority 20) to allow registration of custom table reports.

Parameters:

ParameterTypeDescription
$registryLD<em>Dashboard</em>Report_RegistryThe 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<em>dashboard</em>register_charts

Fires during init (priority 20) to allow registration of custom Chart.js charts.

Parameters:

ParameterTypeDescription
$registryLD<em>Dashboard</em>Report_RegistryThe 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<em>dashboard</em>register_modules

Fires when the module registry boots, before built-in modules are initialized. Register custom modules here.

Parameters:

ParameterTypeDescription
$registryLD<em>Dashboard</em>Module_RegistryThe 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<em>dashboard</em>module_loaded

Fires after a module successfully boots (dependencies met and boot() called).

Parameters:

ParameterTypeDescription
$moduleLD<em>Dashboard</em>Module_BaseThe 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<em>dashboard</em>module<em>{module</em>id}_loaded.


ld<em>dashboard</em>before<em>modules</em>boot

Fires before the module registry iterates and boots registered modules.

Parameters:

ParameterTypeDescription
$registryLD<em>Dashboard</em>Module_RegistryThe registry instance

ld<em>dashboard</em>modules_booted

Fires after all modules have been booted.

Parameters:

ParameterTypeDescription
$registryLD<em>Dashboard</em>Module_RegistryThe registry instance
$modulesarrayArray of active module instances

ld<em>dashboard</em>email_sent

Fires after an email is sent via ld<em>dashboard</em>send_email().

Parameters:

ParameterTypeDescription
$sentboolWhether the email was sent successfully
$template_idstringEmail template ID
$tostringRecipient email address
$argsarrayTemplate arguments passed to the email

Location: includes/emails/class-ld-dashboard-email-template.php

There is also a template-specific variant: ld<em>dashboard</em>email<em>sent</em>{template_id}.


ld<em>dashboard</em>after_save

Fires after any save handler completes. This generic hook fires for every content type.

Parameters:

ParameterTypeDescription
$post_idintSaved post ID
$formarrayFull sanitized form data submitted
$meta_dataarrayMeta data saved to the post
$handlerstringHandler 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<em>dashboard</em>after<em>course</em>save

Fires after a course is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved course post ID
$meta_dataarrayMeta 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<em>dashboard</em>after<em>lesson</em>save

Fires after a lesson is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved lesson post ID
$meta_dataarrayMeta data saved to the post
$course_idintAssociated course ID

Location: includes/save-handlers/class-ld-dashboard-save-handler-lesson.php


ld<em>dashboard</em>after<em>topic</em>save

Fires after a topic is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved topic post ID
$meta_dataarrayMeta data saved to the post
$course_idintAssociated course ID
$lesson_idintAssociated 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<em>dashboard</em>after<em>quiz</em>save

Fires after a quiz is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved quiz post ID
$meta_dataarrayMeta data saved to the post
$course_idintAssociated course ID

Location: includes/save-handlers/class-ld-dashboard-save-handler-quiz.php


ld<em>dashboard</em>after<em>question</em>save

Fires after a question is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved question post ID
$meta_dataarrayMeta data saved to the post
$quiz_idintAssociated quiz post ID

Location: includes/save-handlers/class-ld-dashboard-save-handler-question.php


ld<em>dashboard</em>after<em>certificate</em>save

Fires after a certificate is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved certificate post ID
$meta_dataarrayMeta data saved to the post

Location: includes/save-handlers/class-ld-dashboard-save-handler-certificate.php


ld<em>dashboard</em>after<em>group</em>save

Fires after a LearnDash group is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved group post ID
$meta_dataarrayMeta data saved to the post

Location: includes/save-handlers/class-ld-dashboard-save-handler-group.php


ld<em>dashboard</em>after<em>announcement</em>save

Fires after an announcement is saved via the save handler.

Parameters:

ParameterTypeDescription
$post_idintSaved announcement post ID
$meta_dataarrayMeta data saved to the post
$course_idintAssociated course ID (0 if none or unauthorized)

Location: includes/save-handlers/class-ld-dashboard-save-handler-announcement.php


ld<em>dashboard</em>reports_registered

Fires after all built-in reports and charts are registered. Use this hook to register custom reports.

Parameters:

ParameterTypeDescription
$registryLD<em>Dashboard</em>Report_RegistryThe 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

ld<em>dashboard</em>report_data

Filters report row data after role-based access filtering but before the response is built. Applies to all table reports.

Parameters:

ParameterTypeDescription
$dataarrayReport data rows
$report_idstringReport identifier (e.g., quiz-results)
$argsarrayQuery 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<em>dashboard</em>report<em>{report</em>id}_data.


ld<em>dashboard</em>registered_tabs

Filters the array of registered tab classes. Use this to add, replace, or remove tabs.

Parameters:

ParameterTypeDescription
$tabsarrayArray of tab<em>id => class</em>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<em>dashboard</em>{tab<em>id}</em>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:

ParameterTypeDescription
$argsarrayWP_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<em>dashboard</em>{tab<em>id}</em>content

Filters the rendered HTML content for a tab after all items are rendered.

Parameters:

ParameterTypeDescription
$contentstringRendered HTML

Returns: string Modified HTML.


ld<em>dashboard</em>email_types

Filters the registered email type configurations. Use this to add custom email types or modify existing ones.

Parameters:

ParameterTypeDescription
$email_typesarrayArray 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<em>dashboard</em>email<em>recipient</em>{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:

ParameterTypeDescription
$tostringRecipient email address
$template_idstringEmail template ID
$argsarrayTemplate arguments

Returns: string Modified recipient address.

There is also a generic variant ld<em>dashboard</em>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<em>dashboard</em>email<em>subject</em>{template_id}

Filters the email subject for a specific template before sending. Replace the template ID placeholder with the template ID.

Parameters:

ParameterTypeDescription
$subjectstringEmail subject with merge tags replaced
$template_idstringEmail template ID
$argsarrayTemplate arguments

Returns: string Modified subject.

There is also a generic variant ld<em>dashboard</em>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<em>dashboard</em>email<em>content</em>{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:

ParameterTypeDescription
$contentstringRendered HTML content
$template_idstringEmail template ID
$argsarrayTemplate arguments

Returns: string Modified HTML content.

There is also a generic variant ld<em>dashboard</em>email_content that fires for every template (same parameters).

Location: includes/emails/class-ld-dashboard-email-template.php


ld<em>dashboard</em>email<em>headers</em>{template_id}

Filters email headers for a specific template. Replace the template ID placeholder with the template ID.

Parameters:

ParameterTypeDescription
$headersarrayEmail headers array
$template_idstringEmail template ID
$argsarrayTemplate arguments

Returns: array Modified headers.

There is also a generic variant ld<em>dashboard</em>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<em>dashboard</em>email<em>merge</em>tags

Filters all available merge tag values before replacement in email content and subjects.

Parameters:

ParameterTypeDescription
$tagsarrayMerge tag key-value pairs
$contentstringContent being processed
$argsarrayOriginal 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<em>dashboard</em>email_header

Filters the HTML of the email header wrapper (output of email-header.php).

Parameters:

ParameterTypeDescription
$headerstringEmail header HTML

Returns: string Modified HTML.


ld<em>dashboard</em>email_footer

Filters the HTML of the email footer wrapper (output of email-footer.php).

Parameters:

ParameterTypeDescription
$footerstringEmail footer HTML

Returns: string Modified HTML.


ld<em>dashboard</em>chart<em>{chart</em>id}_data

Filters the complete chart response array for a specific chart.

Parameters:

ParameterTypeDescription
$responsearrayChart response with id, chartData, options, meta
$argsarrayQuery arguments

Returns: array Modified chart response.


ld<em>dashboard</em>email<em>from</em>address

Filters the From email address used in all plugin emails.

Parameters:

ParameterTypeDescription
$from_emailstringFrom email address (defaults to WordPress admin email)

Returns: string Modified From address.


ld<em>dashboard</em>email<em>from</em>name

Filters the From name used in all plugin emails.

Parameters:

ParameterTypeDescription
$from_namestringFrom name (defaults to site name)

Returns: string Modified From name.

Last updated: March 4, 2026