Actions/Filters for Developers

Overview

Uncanny Groups exposes a number of actions and filters for advanced developers building custom functionality on top of the plugin.

Please note: No support is provided for the use of these hooks. They’re intended for developers comfortable working with WordPress actions and filters.

Group Management & report customization

HookTypeWhat it does
uo_report_menu_itemsFilter(New in 6.1.2) Adds or modifies items in the Group Management page’s user dropdown menu, so you can surface custom actions to Group Leaders.
ulgm_group_course_report_columnsFilter(6.1.4) Adds, removes, or reorders columns in the Group Course Report.
ulgm_group_courses_list_get_posts_varsFilterFilters the query variables used to retrieve courses on the Group Management page (receives post vars and group ID).
ulgm_group_courses_list_coursesFilterFilters the retrieved courses list before it’s displayed.
ulgmGroupLeaderDataFilterFilters all data sent to the Group Management page tables (enrolled users, leader data, management features).

Example: add a custom item to the user dropdown

add_filter( 'uo_report_menu_items', function ( $items, $buttons ) {
    // Each item is an HTML string (typically a <button>). Add your own:
    $items['view_profile'] = '<button class="uo-btn uo-right" type="button">'
        . esc_html__( 'View Profile', 'your-textdomain' )
        . '</button>';
    return $items;
}, 10, 2 );

Illustrative only. In v6.1.7 the filter receives the menu items as an associative array of HTML strings (keyed by button name, e.g. quiz_report_button), and a second argument that is an array of boolean flags indicating which built-in buttons are enabled — not a group ID. Inspect the incoming values before modifying them, as the shape may change between versions.

Front-end table events (JavaScript)

These jQuery events fire after the front-end tables finish loading, so you can hook in with custom scripts:

  • enrolledUsersTableDataTableCreated
  • enrolledLeaderTableDataTableCreated

User management

HookTypeWhat it does
ulgm_existing_group_user_addedActionFires when an existing user is added to a group.
ulgm_group_user_invitedActionFires when a new user is invited.
ulgm_group_user_removedActionFires when a user is removed.
ulgm_do_not_send_existing_user_emailFilterControls whether the email is sent for existing users.
ulgm_do_not_send_new_user_emailFilterControls whether the email is sent for newly invited users.
ulgm_gdpr_is_group_leader_allowedFilterValidates group leader permissions before a user is added.

Leader management

HookTypeWhat it does
ulgm_group_leader_addedActionFires when a group leader is added.
ulgm_group_leader_removedActionFires when a group leader is removed.

Email customization

HookWhat it controls
ulgm_redemption_email_to / ulgm_redemption_email_subject / ulgm_redemption_email_bodyRedemption email recipient, subject, and body
ulgm_welcome_email_to / ulgm_welcome_email_subject / ulgm_welcome_email_bodyWelcome email recipient, subject, and body
ld_group_email_users_personalize_subject / ld_group_email_users_personalize_messagePersonalization of bulk “Email Users” campaigns
ulgm_redemption_email_sentAction fired when a redemption email is sent
ulgm_do_not_send_redemption_emailControls whether the redemption email is sent

Other hooks

HookTypeWhat it does
uo_redirect_after_group_createdFilterFilters the redirect URL after a group is created.

REST API filters

These filter the data returned by the plugin’s REST API endpoints:

  • ulgm_rest_api_get_user_course_data
  • ulgm_rest_api_get_group_courses
  • ulgm_rest_api_get_essays_data
  • ulgm_rest_api_get_quiz_data
  • ulgm_rest_api_get_assignments_data

Leave a Reply

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

Uncanny Groups for LearnDash

The best way to sell, manage and report on LearnDash groups.

Scroll to Top