🎉 - Début développement plugin CustomTreeFile

This commit is contained in:
Célian
2025-01-30 04:50:02 +01:00
commit a62549f1b4
6 changed files with 488 additions and 0 deletions

29
custom-template.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
// Add some functions to quickly load template
function tree_get_topbar($name = null, $args = array()) {
do_action("get_topbar", $name, $args);
return false;
$templates = array();
$name = (string) $name;
if ( '' !== $name ) {
$templates[] = "topbar-{$name}.php";
}
$templates[] = 'topbar.php';
if ( ! locate_template( $templates, true, true, $args ) ) {
return false;
}
}
function get_blog_url($blog_id = null) {
if (null === $blog_id) $blog_id = get_current_blog_id();
if (get_current_blog_id() !== $blog_id && get_blogaddress_by_id($blog_id)) switch_to_blog($blog_id);
return get_post_type_archive_link( 'post' );
}