PluginProbe
FileBird – WordPress Media Library Folders & File Manager / 5.3.2
FileBird – WordPress Media Library Folders & File Manager v5.3.2
6.5.8 6.5.7 6.5.5 6.5.4 trunk 4.3.1 5.1.6 5.3 5.3.2 5.4.3 5.4.4 5.4.5 5.5 5.5.3 5.5.5 5.5.8 5.5.8.1 5.6 5.6.1 5.6.2 5.6.3 5.6.4 6.2.3 6.2.5 6.3 All 36 releases
filebird / includes / Support / PageBuilders.php

PageBuilders.php in FileBird – WordPress Media Library Folders & File Manager 5.3.2, at includes/Support/PageBuilders.php

205 lines 4.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace FileBird\Support;
3
4 use FileBird\Controller\Folder;
5
6 defined( 'ABSPATH' ) || exit;
7
8 class PageBuilders {
9 protected $folderController;
10
11 public function __construct() {
12 $this->folderController = Folder::getInstance();
13 add_action( 'init', array( $this, 'prepareRegister' ) );
14 }
15
16 public function prepareRegister() {
17 // Compatible for Elementor
18 if ( defined( 'ELEMENTOR_VERSION' ) ) {
19 $this->registerForElementor();
20 }
21 // Compatible for WPBakery - Work normally
22
23 // Compatible for Beaver Builder
24 if ( class_exists( 'FLBuilderLoader' ) ) {
25 $this->registerForBeaver();
26 }
27
28 // Brizy Builder
29 if ( class_exists( 'Brizy_Editor' ) ) {
30 $this->registerForBrizy();
31 }
32
33 // Cornerstone
34 if ( class_exists( 'Cornerstone_Plugin' ) ) {
35 $this->registerCornerstone();
36 }
37
38 // Compatible for Divi
39 if ( class_exists( 'ET_Builder_Element' ) ) {
40 $this->registerForDivi();
41 }
42
43 // Compatible for Thrive
44 if ( defined( 'TVE_IN_ARCHITECT' ) || class_exists( 'Thrive_Quiz_Builder' ) ) {
45 $this->registerForThrive();
46 }
47
48 // Fusion Builder
49 if ( class_exists( 'Fusion_Builder_Front' ) ) {
50 $this->registerForFusion();
51 }
52
53 // Avada Theme
54 if ( ! class_exists( 'Fusion_Builder_Front' ) && defined( 'AVADA_VERSION' ) ) {
55 $this->registerAvada();
56 }
57
58 // Oxygen Builder
59 if ( defined( 'CT_VERSION' ) ) {
60 $this->registerOxygenBuilder();
61 }
62
63 // Tatsu Builder
64 if ( defined( 'TATSU_VERSION' ) ) {
65 $this->registerTatsuBuilder();
66 }
67
68 // Dokan plugin
69 if ( defined( 'DOKAN_PLUGIN_VERSION' ) ) {
70 $this->registerForDokan();
71 }
72
73 // Themify
74 if ( defined( 'THEMIFY_VERSION' ) && class_exists( 'Themify_Builder_Model' ) ) {
75 $this->registerThemify();
76 }
77
78 // Bricks
79 if ( defined( 'BRICKS_VERSION' ) ) {
80 $this->registerBricksBuilder();
81 }
82
83 // BeTheme
84 if ( defined( 'MFN_THEME_VERSION' ) ) {
85 $this->registerBeBuilder();
86 }
87
88 // LearnPress
89 if ( class_exists( 'LP_Addon_Frontend_Editor_Preload' ) ) {
90 $this->registerLearnPress();
91 }
92 }
93
94 public function enqueueScripts( $is_enqueue_media = false ) {
95 if ( $is_enqueue_media ) {
96 wp_enqueue_media();
97 }
98
99 $this->folderController->enqueueAdminScripts( 'pagebuilders' );
100 }
101
102 public function registerForElementor() {
103 add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'enqueueScripts' ) );
104 }
105
106 public function registerForBeaver() {
107 add_action( 'fl_before_sortable_enqueue', array( $this, 'enqueueScripts' ) );
108 }
109
110 public function registerForBrizy() {
111 add_action( 'brizy_editor_enqueue_scripts', array( $this, 'enqueueScripts' ) );
112 }
113
114 public function registerCornerstone() {
115 add_action( 'cornerstone_before_wp_editor', array( $this, 'enqueueScripts' ) );
116 }
117
118 public function registerForDivi() {
119 add_action(
120 'et_fb_enqueue_assets',
121 function() {
122 $this->enqueueScripts();
123 }
124 );
125 }
126
127 public function registerForThrive() {
128 add_action( 'tcb_main_frame_enqueue', array( $this, 'enqueueScripts' ) );
129 }
130
131 public function registerForFusion() {
132 add_action( 'fusion_builder_enqueue_live_scripts', array( $this, 'enqueueScripts' ) );
133 }
134
135 public function registerOxygenBuilder() {
136 add_action( 'oxygen_enqueue_ui_scripts', array( $this, 'enqueueScripts' ) );
137 }
138
139 public function registerTatsuBuilder() {
140 add_action( 'tatsu_builder_footer', array( $this, 'enqueueScripts' ) );
141 }
142
143 public function registerForDokan() {
144 add_action(
145 'dokan_enqueue_scripts',
146 function() {
147 if ( function_exists( 'dokan_is_seller_dashboard' ) ) {
148 if ( ( dokan_is_seller_dashboard() || ( get_query_var( 'edit' ) && is_singular( 'product' ) ) ) || apply_filters( 'dokan_forced_load_scripts', false ) ) {
149 $this->enqueueScripts();
150 }
151 }
152 }
153 );
154 }
155
156 public function registerThemify() {
157 add_action(
158 'wp_ajax_tb_load_editor',
159 function() {
160 $this->enqueueScripts( true );
161 },
162 9
163 );
164 }
165
166 public function registerBricksBuilder() {
167 if ( function_exists( 'bricks_is_builder' ) && \bricks_is_builder() ) {
168 add_action( 'bricks_after_footer', array( $this, 'enqueueScripts' ) );
169 }
170 }
171
172 public function registerAvada() {
173 add_action( 'fusion_enqueue_live_scripts', array( $this, 'enqueueScripts' ) );
174 }
175
176 public function registerBeBuilder() {
177 add_action(
178 'admin_enqueue_scripts',
179 function() {
180 if ( ! wp_script_is( 'mfn-vbscripts', 'enqueued' ) ) {
181 return;
182 }
183
184 $this->enqueueScripts();
185 },
186 PHP_INT_MAX
187 );
188
189 add_action(
190 'wp_enqueue_scripts',
191 function() {
192 if ( ! wp_script_is( 'mfn-vbscripts', 'enqueued' ) ) {
193 return;
194 }
195
196 $this->enqueueScripts();
197 },
198 PHP_INT_MAX
199 );
200 }
201
202 public function registerLearnPress() {
203 add_action( 'learnpress/addons/frontend_editor/enqueue_scripts', array( $this, 'enqueueScripts' ) );
204 }
205 }