2025-01-30 04:50:02 +01:00
|
|
|
<?php
|
|
|
|
// Add some functions to quickly load template
|
|
|
|
|
2025-02-05 01:03:46 +01:00
|
|
|
/**
|
|
|
|
* Loads the appropriate topbar template file.
|
|
|
|
*
|
|
|
|
* @param string|null $name Optional. The specific topbar name to load.
|
|
|
|
* @param array $args Optional. Additional arguments to pass to the template.
|
|
|
|
* @return bool True if the template was found and loaded, false otherwise.
|
|
|
|
*/
|
2025-01-30 04:50:02 +01:00
|
|
|
function tree_get_topbar($name = null, $args = array()) {
|
|
|
|
|
|
|
|
do_action("get_topbar", $name, $args);
|
|
|
|
|
|
|
|
$templates = array();
|
|
|
|
$name = (string) $name;
|
|
|
|
if ( '' !== $name ) {
|
|
|
|
$templates[] = "topbar-{$name}.php";
|
|
|
|
}
|
|
|
|
|
|
|
|
$templates[] = 'topbar.php';
|
|
|
|
|
|
|
|
if ( ! locate_template( $templates, true, true, $args ) ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|