From 630d4220273fe453299c6d8845667c5b138adc49 Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Fri, 24 May 2024 12:36:33 +0200 Subject: [PATCH] test if this helps problems with elementor --- crouton.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crouton.php b/crouton.php index de40677..c9ef8d7 100644 --- a/crouton.php +++ b/crouton.php @@ -361,7 +361,18 @@ private function getMapInitialization($mapConfig) } return ""; } + private $footerScript; private function getInitializeCroutonBlock($renderCmd, $config, $mapConfig) + { + $this->footerScript = $this->computeInitializeCroutonBlock($renderCmd, $config, $mapConfig); + add_action('wp_footer', array($this, 'printFooterScript'), 99, 0); + return ''; + } + public function printFooterScript() + { + echo $this->footerScript; + } + private function computeInitializeCroutonBlock($renderCmd, $config, $mapConfig) { if (!$this->croutonBlockInitialized) { $this->croutonBlockInitialized = true;