🚚📝 - Réorganisation des fichiers et ajout de documentation pour les fonctions existantes

This commit is contained in:
2025-02-05 01:03:46 +01:00
parent e67d1f86d7
commit a0b5f2033f
2 changed files with 36 additions and 10 deletions

View File

@@ -0,0 +1,26 @@
<?php
// Add some functions to quickly load template
/**
* 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.
*/
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;
}
}