uo_dashboard_template
Filters the path to the dashboard template file used by the plugin.
add_filter( 'uo_dashboard_template', $callback, 10, 1 );
Description
Filters the path to the template file used for the Uncanny Toolkit Pro frontend dashboard. Developers can use this to override the default dashboard template by providing a custom file path.
Usage
add_filter( 'uo_dashboard_template', 'your_function_name', 10, 1 );
Parameters
-
$filepath(mixed) - This parameter contains the file path to the template used for displaying the dashboard.
Return Value
The filtered value.
Examples
<?php
/**
* Filter the dashboard template file path to load a custom template.
*
* This example demonstrates how to change the default dashboard template
* to a custom one located in your theme's 'templates' directory.
*
* @param string $file_path The current template file path.
* @return string The modified template file path.
*/
add_filter( 'uo_dashboard_template', 'my_custom_dashboard_template', 10, 1 );
function my_custom_dashboard_template( $file_path ) {
// Define the path to your custom template file within your theme's directory.
$custom_template_path = get_stylesheet_directory() . '/my-theme-templates/uncanny-toolkit-pro/dashboard-template.php';
// Check if the custom template file exists.
if ( file_exists( $custom_template_path ) ) {
// If it exists, return the path to the custom template.
return $custom_template_path;
}
// If the custom template doesn't exist, return the original file path.
return $file_path;
}
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/classes/reports/learndash-progress-report.php:1669
public static function uo_dashboard_get_template() {
$filepath = Utilities::get_template( 'frontend-course-management/dashboard-template-3_0.php' );
return apply_filters( 'uo_dashboard_template', $filepath );
}