Action tin-canny-learndash-reporting

tincanny_reporting_course_report_after_end

Fires after a course report has ended, allowing for custom post-report actions.

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

Description

Fires after the course report tab content has ended. Developers can use this hook to add custom content or functionality after the standard course report elements. It's intended for internal use and specific integrations within the Tin Can Reporting system.


Usage

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

Examples

<?php
/**
 * Example of adding a function to the 'tincanny_reporting_course_report_after_end' action hook.
 * This function will add a custom notice to the course report tab after the default content.
 */
add_action( 'tincanny_reporting_course_report_after_end', 'my_custom_course_report_notice', 10 );

/**
 * Displays a custom notice after the course report.
 *
 * @since 1.0.0
 */
function my_custom_course_report_notice() {
	// This function doesn't take any arguments as per the hook definition.

	// In a real-world scenario, you might want to check certain conditions
	// before displaying the notice. For example, if the user has a specific role,
	// or if a certain setting is enabled in your plugin.

	// For demonstration, let's assume we want to show a message to administrators.
	if ( current_user_can( 'manage_options' ) ) {
		echo '<div class="tincanny-custom-notice" style="background-color: #e0f7fa; border: 1px solid #00acc1; padding: 15px; margin-top: 20px; border-radius: 4px;">';
		echo '<h4>Custom Notice:</h4>';
		echo '<p>This is a custom message added after the Tin Canny course report. You can use this space to provide additional insights or instructions to administrators.</p>';
		echo '<p><strong>Example:</strong> You might want to remind them to review recent quiz submissions or upcoming course deadlines.</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/learndash/templates/course-report-tab.php:12

die;
}

?>

<div class="uo-admin-reporting-tab-single" id="courseReportTab" style="display: block">

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

	<?php if( false === TinCannyShortcode::$is_independent_shortcode || is_admin() ){  ?>
	<div id="reporting-course-navigation" class="reporting-breadcrumbs">
		<ul class="reporting-breadcrumbs-items">
			<li class="reporting-breadcrumbs-item reporting-breadcrumbs-item--guide">
				<span><?php _e( 'Tin Canny Reports', 'uncanny-learndash-reporting' ); ?></span>
			</li>


Scroll to Top