summaryrefslogtreecommitdiff
path: root/src/ThemeEditor.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2020-10-28 20:03:06 +0100
committerDaniel Weipert <code@drogueronin.de>2020-10-28 20:03:06 +0100
commitff5b1598c918b12ff9b222b0397b43d0ed5ffae6 (patch)
tree8005ae5d8990d0d2dd6bf1f2b9f5576b2edc0872 /src/ThemeEditor.php
parentfc7cf1662c93bd0028cbd88c6f56917eae771312 (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.php4
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']);
}
}
}