PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.0-dev9
Elementor Website Builder – more than just a page builder v3.4.0-dev9
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/preview.php +13 -24 4.0.93.4.0-dev9 View file →
@@ -1,9 +1,8 @@
1 1 <?php
2 2 namespace Elementor;
3 3
4 4 use Elementor\Core\Base\App;
5 -use Elementor\Core\Settings\Manager as SettingsManager;
6 5
7 6 if ( ! defined( 'ABSPATH' ) ) {
8 7 exit; // Exit if accessed directly.
9 8 }
@@ -18,13 +17,8 @@
18 17 */
19 18 class Preview extends App {
20 19
21 20 /**
22 - * The priority of the preview enqueued styles.
23 - */
24 - const ENQUEUED_STYLES_PRIORITY = 20;
25 -
26 - /**
27 21 * Is Preview.
28 22 *
29 23 * Holds a flag if current request is a preview.
30 24 * The flag is not related to a specific post or edit permissions.
@@ -107,9 +101,9 @@
107 101
108 102 add_action( 'wp_enqueue_scripts', function() {
109 103 $this->enqueue_styles();
110 104 $this->enqueue_scripts();
111 - }, self::ENQUEUED_STYLES_PRIORITY );
105 + } );
112 106
113 107 add_filter( 'the_content', [ $this, 'builder_wrapper' ], 999999 );
114 108
115 109 add_action( 'wp_footer', [ $this, 'wp_footer' ] );
@@ -234,13 +228,11 @@
234 228 wp_add_inline_script( 'jquery-migrate', 'jQuery.holdReady( true );' );
235 229
236 230 Plugin::$instance->frontend->enqueue_styles();
237 231
238 - Plugin::$instance->elements_manager->enqueue_elements_styles();
239 -
240 232 Plugin::$instance->widgets_manager->enqueue_widgets_styles();
241 233
242 - $suffix = Utils::is_script_debug() ? '' : '.min';
234 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
243 235
244 236 $direction_suffix = is_rtl() ? '-rtl' : '';
245 237
246 238 wp_register_style(
@@ -258,19 +250,20 @@
258 250 ],
259 251 ELEMENTOR_VERSION
260 252 );
261 253
262 - wp_enqueue_style(
263 - 'e-theme-ui-light',
264 - $this->get_css_assets_url( 'theme-light' ),
265 - [],
266 - ELEMENTOR_VERSION
267 - );
254 + wp_enqueue_style( 'editor-preview' );
268 255
269 - wp_enqueue_style( 'editor-preview' );
256 + if ( ! Plugin::$instance->experiments->is_feature_active( 'e_dom_optimization' ) ) {
257 + wp_register_style(
258 + 'editor-preview-legacy',
259 + ELEMENTOR_ASSETS_URL . 'css/editor-preview-legacy' . $direction_suffix . $suffix . '.css',
260 + [],
261 + ELEMENTOR_VERSION
262 + );
270 263
271 - // Handle the 'wp audio' in editor preview.
272 - wp_enqueue_style( 'wp-mediaelement' );
264 + wp_enqueue_style( 'editor-preview-legacy' );
265 + }
273 266
274 267 /**
275 268 * Preview enqueue styles.
276 269 *
@@ -294,11 +287,10 @@
294 287 private function enqueue_scripts() {
295 288 Plugin::$instance->frontend->register_scripts();
296 289
297 290 Plugin::$instance->widgets_manager->enqueue_widgets_scripts();
298 - Plugin::$instance->elements_manager->enqueue_elements_scripts();
299 291
300 - $suffix = Utils::is_script_debug() ? '' : '.min';
292 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
301 293
302 294 wp_enqueue_script(
303 295 'elementor-inline-editor',
304 296 ELEMENTOR_ASSETS_URL . 'lib/inline-editor/js/inline-editor' . $suffix . '.js',
@@ -305,11 +297,8 @@
305 297 [],
306 298 ELEMENTOR_VERSION,
307 299 true
308 300 );
309 -
310 - // Handle the 'wp audio' in editor preview.
311 - wp_enqueue_script( 'wp-mediaelement' );
312 301
313 302 /**
314 303 * Preview enqueue scripts.
315 304 *