diff --git a/CustomThemeTree.php b/CustomThemeTree.php index d7bb92f..72204eb 100644 --- a/CustomThemeTree.php +++ b/CustomThemeTree.php @@ -38,7 +38,6 @@ class CustomThemeTree extends TemplateLoader { ] ); - public function __construct($dirs = null, $config_file = "theme.php") { /** * Constructor method to initialize theme settings and configuration. @@ -59,7 +58,6 @@ class CustomThemeTree extends TemplateLoader { } file_put_contents($this->theme_directory . "/" . $this->config_directory . "/theme.php", "theme_directory . "/" . $this->config_directory . "/" . $config_file; require_once $this->theme_directory . "/" . $this->config_directory . "/" . "theme.php"; if (!USE_CUSTOMTREE_PLUGIN) return; @@ -110,7 +108,6 @@ class CustomThemeTree extends TemplateLoader { */ private function create_custom_directories(): void { // Make all directories for templates - $this->templates_directory = $this->create_directory(TEMPLATES_DIR); if (!defined("TEMPLATES_SUBDIRS")) { @@ -179,6 +176,5 @@ class CustomThemeTree extends TemplateLoader { if (!file_exists($this->theme_directory . "/" . TEMPLATES_DIR . "/components/header.php")) file_put_contents($this->theme_directory . "/" . TEMPLATES_DIR . "/components/header.php", "theme_directory . "/" . TEMPLATES_DIR . "/components/footer.php")) file_put_contents($this->theme_directory . "/" . TEMPLATES_DIR . "/components/footer.php", "theme_directory . "/" . STYLESHEETS_DIR . "/style.css")) file_put_contents($this->theme_directory . "/" . STYLESHEETS_DIR . "/css/style.css", ""); } } \ No newline at end of file diff --git a/TemplateLoader.php b/TemplateLoader.php index 66e287f..106d073 100644 --- a/TemplateLoader.php +++ b/TemplateLoader.php @@ -2,7 +2,6 @@ namespace Skycel\CustomTree; -use Error; use WP_Error; /** @@ -256,31 +255,7 @@ class TemplateLoader { $template_path = get_template_directory() . "/" . TEMPLATES_DIR . "/" . TEMPLATES_SUBDIRS["components"]; self::$templates_parts[] = $template_path . "/" . $component_name . ".php"; -// comments_template(); do_action("template_render", self::$templates_parts, $hook_name); } - - - - // Old code - - - - /*public static function getComponents($name, $args):string { - global $wp_stylesheet_path; - $wp_stylesheet_path = get_theme_root() . "/" . get_template() . "/" . TEMPLATES_DIR . "/" . TEMPLATES_SUBDIRS["components"]; - - $hook_name = current_filter(); - - $component_name = preg_replace("/^get_/m", "", $hook_name); - - $file = $wp_stylesheet_path . "/" . $component_name . ".php"; - - if (file_exists($file)) { - return $file; - } else { - return throw new Error("Template file not found: " . $file); - } - }*/ } \ No newline at end of file diff --git a/custom-theme-tree.php b/custom-theme-tree.php index 0f14e19..60c7683 100644 --- a/custom-theme-tree.php +++ b/custom-theme-tree.php @@ -9,22 +9,9 @@ use Skycel\CustomTree\CustomThemeTree; -require_once __DIR__ . "/custom-template.php"; -require_once __DIR__ . "/functions.php"; require_once __DIR__ . "/includes/custom-template.inc.php"; require_once __DIR__ . "/includes/functions.inc.php"; -function test_plugin(): void { - if (!\defined('USE_CUSTOMTREE_PLUGIN') || USE_CUSTOMTREE_PLUGIN !== true) { - return; - } - - if (!\defined("CUSTOMTREE") || !is_array(CUSTOMTREE)) { - new CustomThemeTree(); - } else { - new CustomThemeTree(\CUSTOMTREE); - } - /** * Loads the custom tree plugin if enabled and properly configured. *