tincanny_reporting_tin_can_after_begin
Fires after the tin can reporting process begins, allowing for custom actions.
add_action( 'tincanny_reporting_tin_can_after_begin', $callback, 10, 1 );
Description
Fires after the initial Tin Can reporting section in the admin is rendered. Developers can use this hook to append custom content, initialize JavaScript for the reporting area, or add additional reporting elements.
Usage
add_action( 'tincanny_reporting_tin_can_after_begin', 'your_function_name', 10, 1 );
Examples
/**
* Example function to hook into 'tincanny_reporting_tin_can_after_begin'.
*
* This function demonstrates adding custom content or logic after the
* Tin Can reporting section begins in the admin area. For example,
* it could be used to display a custom message or load additional scripts.
*/
add_action( 'tincanny_reporting_tin_can_after_begin', function() {
// Check if we are in the admin context to avoid running on the frontend.
if ( ! is_admin() ) {
return;
}
// Example: Display a simple informational message.
echo '<div class="notice notice-info"><p>Tin Can reporting data is being loaded. Please wait...</p></div>';
// Example: Conditionally load a JavaScript file if needed for the Tin Can report.
// You would replace 'path/to/your/custom-tin-can-script.js' with the actual path.
// wp_enqueue_script( 'custom-tin-can-script', plugin_dir_url( __FILE__ ) . 'assets/js/custom-tin-can-script.js', array( 'jquery' ), '1.0', true );
});
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/shortcode-tincanny/shortcode-tincanny.php:824
src/shortcode-tincanny/shortcode-tincanny.php:885
public static function admin_reporting_content() {
?>
<div class="uo-admin-reporting-tab-single" id="tin-can"
style="display: <?php echo self::$is_tincan_report ? 'block' : 'none'; ?>">
<?php
// Add Tin Can tab content.
if ( self::$is_tincan_report ) {
do_action( 'tincanny_reporting_tin_can_after_begin' );
include dirname( UO_REPORTING_FILE ) . '/src/reporting/tin-can/templates/tc-tincan-filter.php';
do_action( 'tincanny_reporting_tin_can_before_end' );
}
?>
</div>
<div class="uo-admin-reporting-tab-single" id="xapi-tincan"
style="display: <?php echo self::$is_xapi_report ? 'block' : 'none'; ?>">
<?php
// Add xAPI tab content.
if ( self::$is_xapi_report ) {
do_action( 'tincanny_reporting_xtin_quiz_after_begin' );
self::show_tincan_list_table( 'xapi-tincan' );
do_action( 'tincanny_reporting_xtin_quiz_before_end' );
}
?>
</div>
<?php
}