-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathenqueue.php
52 lines (39 loc) · 1.27 KB
/
enqueue.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Enqueue for Beaver Builder
* @see /system/editor
*/
use tangible\template_system;
$plugin->beaver_template_editor_enqueued = false;
$plugin->enqueue_beaver_template_editor = function() use ( $plugin, $html ) {
if ($plugin->beaver_template_editor_enqueued
|| ! FLBuilderModel::is_builder_active()
) return;
$plugin->beaver_template_editor_enqueued = true;
if (template_system\get_settings('codemirror_6')) {
template_system\enqueue_codemirror_v6();
} else {
template_system\enqueue_codemirror_v5();
}
$url = template_system::$state->url . '/integrations/beaver/build';
$version = template_system::$state->version;
wp_enqueue_style(
'tangible-beaver-template-editor',
$url . '/beaver-template-editor.min.css',
[],
$version
);
// Script is at ./modules/tangible-template/js/settings.js
/**
* Module loader - Support loading scripts and styles when page builders fetch and insert HTML
*/
$html->enqueue_module_loader();
/**
* Action hook for Tangible Blocks
* @see tangible-blocks/includes/integrations/beaver/enqueue.php
*/
do_action('tangible_enqueue_beaver_template_editor');
};
add_action('wp_enqueue_scripts', function() use ( $plugin ) {
$plugin->enqueue_beaver_template_editor();
}, 10);