diff --git a/source/php/ComponentsJs.php b/source/php/ComponentsJs.php index 9d42472..9c03741 100644 --- a/source/php/ComponentsJs.php +++ b/source/php/ComponentsJs.php @@ -18,7 +18,6 @@ public function __construct() ]; - add_action('init', array($this, 'createComponents')); add_action('wp_enqueue_scripts', array($this, 'renderComponents'), 50); } @@ -29,6 +28,8 @@ public function __construct() */ public function renderComponents() //:void { + $this->createComponents(); + wp_localize_script( 'algolia-index-js-searchpage', 'algoliaSearchComponents',