Action tin-canny-learndash-reporting

tincanny_reporting_wrapper_after_begin

Fires after the main reporting section wrapper begins, allowing for custom actions or content injection.

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

Description

Fires after the reporting wrapper begins. This hook allows developers to inject custom content or modify the reporting interface after the initial setup but before the main content is displayed. It's primarily used for extending the reporting section with custom elements.


Usage

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

Examples

<?php
/**
 * Example: Add custom content to the reporting wrapper after it begins.
 * This might be used to inject a quick summary or a related quick link.
 *
 * Hook: tincanny_reporting_wrapper_after_begin
 * Type: action
 * Parameters: None
 */
add_action( 'tincanny_reporting_wrapper_after_begin', 'my_custom_reporting_wrapper_content' );

function my_custom_reporting_wrapper_content() {
	// Check if we are on a user report page and if the user has specific capabilities.
	// This is just an example of conditional logic you might use.
	if ( is_admin() && current_user_can( 'manage_options' ) ) {
		$user_id = isset( $_GET['user_id'] ) ? absint( $_GET['user_id'] ) : get_current_user_id();

		if ( $user_id ) {
			echo '<div class="ultc-reporting-quick-actions" style="margin-bottom: 20px; padding: 10px; background-color: #eef7fc; border: 1px solid #d0e7f5;">';
			echo '<h4>Quick Actions</h4>';
			echo '<p>';
			echo '<a href="' . esc_url( admin_url( 'admin.php?page=tincanny_reports&user_id=' . $user_id . '&tc_filter_mode=export' ) ) . '" class="button button-secondary">Export User Report</a>';
			// Add more quick actions as needed.
			echo '</p>';
			echo '</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:34
src/reporting/tin-can/tin-can-report.php:34
src/shortcode-tincanny/frontend.php:30
src/reporting/learndash/templates/course-user-wrapper.php:24

// Include Setup
					include __DIR__ . '/templates/setup.php';

					// Include Filter
					include __DIR__ . '/templates/xapi-quiz-filter.php';
					?>

					<?php do_action( 'tincanny_reporting_wrapper_after_begin' ); ?>

					<section id="first-tab-group" class="uo-admin-reporting-tabgroup">

						<?php

						do_action( 'tincanny_reporting_before_content' );
						if ( ! ultc_filter_has_var( 'tc_filter_mode' ) ) {


Scroll to Top