Skip to content

Hooks and Filters

The addon exposes actions and filters so you can extend its behavior without editing plugin files. The hooks below are the ones registered in the addon’s own code. LearnDash’s own template hooks (for example the learndash-* and learndash_group_* families) are re-fired from the overridden templates and remain available as documented by LearnDash.

Group grid card hooks (from the modern groups shortcode):

do_action( 'reign_before_group_card', $group_id );
do_action( 'reign_group_card_before_content', $group_id );
do_action( 'reign_group_card_after_content', $group_id );
do_action( 'reign_after_group_card', $group_id );
// Swap the group card template.
apply_filters( 'reign_modern_groups_card_template', $template, $group_id );

Course instructor and author filters (from the modern courses shortcode):

apply_filters( 'reign_learndash_course_instructors', $instructors, $atts );
apply_filters( 'reign_learndash_instructor_query_args', $args );
apply_filters( 'reign_learndash_instructor_roles', $roles );
apply_filters( 'reign_learndash_course_authors_list', $authors );
// Fires after single course content; the related-courses module hooks here.
do_action( 'reign_learndash_after_course_content', $course_id );
// Filter the resolved course price.
apply_filters( 'get_reign_ld_course_price', $price, $course_id );
// Filter the default (placeholder) course image markup.
apply_filters( 'reign_ld_default_course_image_html', $html, $course_id );
// Group single-page course display controls.
apply_filters( 'reign_group_courses_display_limit', $limit );
apply_filters( 'reign_group_courses_simplified_view', $bool );
apply_filters( 'lm_filter_course_author_url', $url, $author_id );
apply_filters( 'lm_filter_group_leader_url', $url, $leader_id );
// Override which template file is located.
apply_filters( 'learnmate_locate_template', $template, $template_name );
// Fires once the addon has finished loading.
do_action( 'learnmate_learndash_addon_loaded' );
// Course/group data tabs and feature lists.
apply_filters( 'learnmate_course_data_tabs', $tabs );
apply_filters( 'learnmate_modify_course_features_in_tab', $features, $course_id );
apply_filters( 'learnmate_modify_group_features_in_tab', $features, $group_id );
// LearnDash groups archive slug.
apply_filters( 'reign_learndash_groups_slug', $slug );

Each activity type can be skipped by returning true from its filter, and the addon exposes tab and per-row controls:

apply_filters( 'reign_learndash_skip_enrollment_activity', false, $user_id, $course_id );
apply_filters( 'reign_learndash_skip_course_completion_activity', false, $user_id, $course_id );
apply_filters( 'reign_learndash_skip_lesson_completion_activity', false, ... );
apply_filters( 'reign_learndash_skip_topic_completion_activity', false, ... );
apply_filters( 'reign_learndash_skip_quiz_completion_activity', false, ... );
apply_filters( 'reign_learndash_skip_comment_activity', false, ... );
apply_filters( 'reign_learndash_activity_default_parameters', $params );
apply_filters( 'get_default_reign_learndash_activity_content', $content );
apply_filters( 'reign_bp_ld_format_activity_action', $action );
// Profile Courses tab and per-row counts.
apply_filters( 'reign_learndash_primary_bp_tab_name', $name );
apply_filters( 'reign_learndash_secondary_bp_tab_name', $name );
apply_filters( 'reign_course_per_page', $per_page );
apply_filters( 'reign_learndash_buddypress_course_per_row', $per_row );

The review system fires a set of wb_ld_course_review_* actions and filters around the review markup and rating output, for example:

do_action( 'wb_ld_course_review_before', $comment );
do_action( 'wb_ld_course_review_meta', $comment );
apply_filters( 'wb_ld_course_get_star_rating_html', $html, $rating );
apply_filters( 'wb_ld_course_review_analytics_exception', $value );
apply_filters( 'wb_ld_course_review_gravatar_size', $size );
apply_filters( 'wb_ld_widget_filter_course_args', $args );
apply_filters( 'widget_ld_course_categories_args', $args );
do_action( 'reign_ld_show_course_price', $course_id );

Earlier drafts of the developer notes referenced hooks such as reign_courses_query_args, reign_course_card_html, reign_before_courses_grid, reign_course_enrolled, and reign_course_button_text. Those are not registered in the addon and will never fire. Use the hooks listed on this page.