From ff5b1598c918b12ff9b222b0397b43d0ed5ffae6 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 28 Oct 2020 20:03:06 +0100 Subject: Gets local copies of needed codemirror js and css files via webpack and enqueues those instead of the remote files --- src/ThemeEditor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ThemeEditor.php') diff --git a/src/ThemeEditor.php b/src/ThemeEditor.php index 0b62264..194b59d 100644 --- a/src/ThemeEditor.php +++ b/src/ThemeEditor.php @@ -62,12 +62,12 @@ class ThemeEditor 'wp-codemirror', 'window.CodeMirror = wp.CodeMirror;' ); - wp_enqueue_script('mode-twig', 'https://unpkg.com/codemirror@5/mode/twig/twig.js', ['wp-codemirror']); + wp_enqueue_script('codemirror-mode-twig', timberEditorAssetsUrl('codemirror/mode/twig/twig.js'), ['wp-codemirror']); } $theme = $settings['codemirror']['theme']; if ($theme != 'default') { - wp_enqueue_style('codemirror-theme', "https://unpkg.com/codemirror@5/theme/$theme.css", ['wp-codemirror']); + wp_enqueue_style('codemirror-theme', timberEditorAssetsUrl("codemirror/theme/$theme.css"), ['wp-codemirror']); } } } -- cgit v1.2.3