uncanny_toolkit_dashboard_header_after
Fires after the Uncanny Toolkit dashboard header, allowing custom content insertion.
add_action( 'uncanny_toolkit_dashboard_header_after', $callback, 10, 1 );
Description
Fires after the Uncanny Toolkit dashboard header and tabs are displayed. Use this action to add custom content or modify the dashboard header area, such as including additional buttons, information, or custom markup before the main module list.
Usage
add_action( 'uncanny_toolkit_dashboard_header_after', 'your_function_name', 10, 1 );
Examples
/**
* Example of adding content after the Uncanny Toolkit dashboard header.
* This could be used to display a quick stats overview or a call to action.
*/
add_action( 'uncanny_toolkit_dashboard_header_after', 'my_uncanny_toolkit_custom_dashboard_content', 10, 0 );
function my_uncanny_toolkit_custom_dashboard_content() {
// Let's fetch some hypothetical data, perhaps the number of active modules.
// In a real scenario, you'd likely use functions provided by Uncanny Toolkit
// or WordPress core to get this data.
$all_modules = Uncanny_Toolkit_Admin::get_modules(); // Assuming this method exists and returns all modules
$active_modules_count = 0;
if ( ! empty( $all_modules ) ) {
foreach ( $all_modules as $module_key => $module_data ) {
if ( Uncanny_Toolkit_Admin::is_module_active( $module_key ) ) { // Assuming this method exists
$active_modules_count++;
}
}
}
// Display some custom information.
?>
<div class="uncanny-toolkit-custom-stats" style="background-color: #f0f0f0; padding: 15px; margin-bottom: 20px; border: 1px solid #ddd;">
<h3>Your Uncanny Toolkit Summary</h3>
<p>You currently have <strong><?php echo esc_html( $active_modules_count ); ?></strong> out of <?php echo count( $all_modules ); ?> Uncanny Toolkit modules active.</p>
<p>Keep exploring to enhance your WordPress site!</p>
</div>
<?php
}
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/admin-menu.php:177
src/templates/admin-support.php:18
public static function options_menu_page_output() {
$modules = self::get_modules();
?>
<div class="wrap uncannyowl-default-design">
<?php
// Add admin header and tabs.
$tab_active = 'uncanny-toolkit';
require Config::get_template( 'admin-header.php' );
?>
<?php do_action('uncanny_toolkit_dashboard_header_after'); ?>
<?php include( Config::get_template( 'admin-modules.php' ) ) ?>
</div>
<?php self::create_features();
}