Action tin-canny-learndash-reporting

tincanny_reporting_after_opening_wrapper

Fires after the Tin Can API reporting wrapper is opened, allowing for modifications before content is rendered.

add_action( 'tincanny_reporting_after_opening_wrapper', $callback, 10, 1 );

Description

Fires after the main Tincanny reporting wrapper div is opened. Developers can hook into this action to add custom content or modify the reporting interface before the header and tabs are rendered. This hook provides an opportunity to inject elements directly within the primary reporting container.


Usage

add_action( 'tincanny_reporting_after_opening_wrapper', 'your_function_name', 10, 1 );

Examples

<?php
/**
 * Example function to hook into 'tincanny_reporting_after_opening_wrapper'.
 * This function adds a custom notification message after the reporting wrapper opens.
 */
add_action( 'tincanny_reporting_after_opening_wrapper', 'ucr_add_custom_reporting_notification', 10 );

/**
 * Adds a custom notification to the Tin Can Reporting interface.
 *
 * @param array $args An array of arguments passed to the hook. (This hook doesn't explicitly pass arguments, but we include it for best practice).
 */
function ucr_add_custom_reporting_notification( $args = [] ) {
    // Check if we are in the admin area and if the notification is relevant.
    // In a real-world scenario, you might check for specific reporting pages or contexts.
    if ( is_admin() ) {
        echo '<div class="ucr-custom-notification notice notice-info is-dismissible"><p>Reporting data is being loaded. Please wait a moment.</p></div>';
    }
}
?>

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/xapi-quiz-report.php:6
src/reporting/tin-can/tin-can-report.php:6
src/shortcode-tincanny/frontend.php:9
src/reporting/learndash/templates/course-user-wrapper.php:6

<div class="tclr wrap" id="tincanny-reporting"
     data-context="">
	<div id="ld_course_info" class="uo-tclr-admin uo-admin-reporting">

		<?php
		do_action( 'tincanny_reporting_after_opening_wrapper' );

		uncanny_learndash_reportingTinCannyShortcode::add_header_and_tabs();

		do_action( 'tincanny_reporting_wrapper_before_begin' );

		?>


Scroll to Top