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;