From 29027616f37c597e950cc92601d9d6a1fcdc3b39 Mon Sep 17 00:00:00 2001
From: Max <m.giller.dev@gmail.com>
Date: Sun, 14 Nov 2021 17:39:50 +0100
Subject: [PATCH] Fixed incorrect handle for 3d graph

---
 knowledge-space.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/knowledge-space.php b/knowledge-space.php
index d1f70c0..28e0b4c 100644
--- a/knowledge-space.php
+++ b/knowledge-space.php
@@ -15,7 +15,7 @@ function ks_add_graph($atts = []): string
 
     $script_path = 'build' . DIRECTORY_SEPARATOR . $GLOBALS['build'] . DIRECTORY_SEPARATOR . 'graph.js';
     wp_enqueue_script("ks-display-js", plugins_url($script_path, __FILE__), array('jquery'), false);
-    ks_localize();
+    ks_localize("ks-display-js");
 
     return $div;
 }
@@ -25,12 +25,12 @@ function ks_echo_graph($atts = []): void
     echo ks_add_graph($atts);
 }
 
-function ks_localize()
+function ks_localize($handle)
 {
     $space_id = kg_get_space_id_from_atts($atts);
     $plugin_dir = plugin_dir_url(__FILE__);
     wp_localize_script(
-        'ks-editor-js',
+        $handle,
         'ks_global',
         array(
             'ajax_url' => admin_url('admin-ajax.php'),
@@ -43,7 +43,7 @@ function ks_localize()
 function ks_add_editor($atts = [])
 {
     ks_add_editor_dependencies();
-    ks_localize();
+    ks_localize("ks-editor-js");
 
     require_once(__DIR__ . '/editor/editor.php');
 }
-- 
GitLab