Filter tin-canny-learndash-reporting

uo_tin_can_filter_section_heading

Filters the heading text for the user and group section within the Tin Can filter.

add_filter( 'uo_tin_can_filter_section_heading', $callback, 10, 1 );

Description

Filters the heading text for the Tin Can filter section, allowing developers to customize it. The default is "User & Group". Use this hook to change the heading's appearance or content for different reporting contexts.


Usage

add_filter( 'uo_tin_can_filter_section_heading', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

/**
 * Example of how to modify the section heading for the Tin Can filter.
 *
 * This filter allows you to change the default 'User & Group' heading
 * for a specific section within the Tin Can reporting filters.
 *
 * @param string $heading The original heading text.
 * @return string The modified heading text.
 */
add_filter( 'uo_tin_can_filter_section_heading', function( $heading ) {
    // Example: If we want to specifically rename this section when viewing group reports.
    // In a real scenario, you might check for specific query parameters or user roles.
    if ( isset( $_GET['tab'] ) && 'uncanny-tincanny-group-report' === $_GET['tab'] ) {
        return esc_html__( 'Learners in Group', 'my-custom-translation-domain' );
    }

    // Otherwise, return the original heading or your default modified heading.
    return $heading; // Or a different default if you prefer.
}, 10, 1 ); // 10 is the priority, 1 is the number of accepted arguments.

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/reporting/xapi-quiz/templates/xapi-quiz-filter.php:99
src/reporting/tin-can/templates/tc-tincan-filter.php:103

<input type="hidden" name="tab" value="uncanny-tincanny-xapi-quiz-report"/>

<!--                <input type="hidden" name="orderby" value="--><?php //esc_attr( $tc_order_by_filter ); ?><!--"/>-->
<!--                <input type="hidden" name="order" value="--><?php //esc_attr( $tc_order_filter ); ?><!--"/>-->
                <div class="reporting-tincan-filters-columns">
                    <div class="reporting-tincan-filters-col reporting-tincan-filters-col--1">
                        <div class="reporting-tincan-section__title">
							<?php echo apply_filters( 'uo_tin_can_filter_section_heading', esc_html_x( 'User & Group', 'Tin Can Filter Group name', 'uncanny-learndash-reporting' ) ); ?>
                        </div>
                        <div class="reporting-tincan-section__content">
                            <div class="reporting-tincan-section__field">

                                <label for="tc_filter_group"><?php echo ucfirst( apply_filters( 'uo_tin_can_filter_group_label', esc_html_x( 'Groups', 'Tin Can Filter Group name', 'uncanny-learndash-reporting' ), true ) ); ?></label>
                                <select class="uo-admin-select" name="tc_filter_group" id="tc_filter_group">
                                    <option value="">


Scroll to Top