From a448c00a1d89fbe478de4bc366aca7182001a246 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 14 Feb 2021 08:14:57 -0800 Subject: [PATCH] Fixes #4382 - Init theme shortcodes later. --- e107_core/templates/header_default.php | 5 +++++ e107_handlers/shortcode_handler.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 1b86f46b3..0bcb8dd02 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -33,6 +33,11 @@ $e107 = e107::getInstance(); $sql = e107::getDb(); e107::getDebug()->logTime('(Header Top)'); +if($themeSC = e107::getScBatch('theme')) // init theme_shortcodes after THEME_LAYOUT is available. +{ + $themeSC->init(); + unset($themeSC); +} e107::getRender()->init(); diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index dd7a2e2d0..8c7849c7d 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -292,7 +292,7 @@ class e_parse_shortcode { $this->scClasses[$class] = new $class(); - if(method_exists($this->scClasses[$class], 'init')) + if($class !== 'theme_shortcodes' && method_exists($this->scClasses[$class], 'init')) { $this->scClasses[$class]->init(); }