diff options
author | Daniel Weipert <code@drogueronin.de> | 2020-10-28 20:03:06 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2020-10-28 20:03:06 +0100 |
commit | ff5b1598c918b12ff9b222b0397b43d0ed5ffae6 (patch) | |
tree | 8005ae5d8990d0d2dd6bf1f2b9f5576b2edc0872 /src/ThemeEditor.php | |
parent | fc7cf1662c93bd0028cbd88c6f56917eae771312 (diff) |
Gets local copies of needed codemirror js and css files via webpack and enqueues those instead of the remote files
Diffstat (limited to 'src/ThemeEditor.php')
-rw-r--r-- | src/ThemeEditor.php | 4 |
1 files changed, 2 insertions, 2 deletions
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']); } } } |