PluginProbe
Elementor Website Builder – more than just a page builder / 3.9.2
Elementor Website Builder – more than just a page builder v3.9.2
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 +14 -31 4.1.33.9.2 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' ] );
@@ -194,20 +188,8 @@
194 188 return true;
195 189 }
196 190
197 191 /**
198 - * Whether WordPress post preview or Elementor preview iframe is active.
199 - *
200 - * @since 4.1.0
201 - * @access public
202 - *
203 - * @return bool
204 - */
205 - public function is_editor_or_preview() {
206 - return is_preview() || $this->is_preview_mode();
207 - }
208 -
209 - /**
210 192 * Builder wrapper.
211 193 *
212 194 * Used to add an empty HTML wrapper for the builder, the javascript will add
213 195 * the content later.
@@ -246,13 +228,11 @@
246 228 wp_add_inline_script( 'jquery-migrate', 'jQuery.holdReady( true );' );
247 229
248 230 Plugin::$instance->frontend->enqueue_styles();
249 231
250 - Plugin::$instance->elements_manager->enqueue_elements_styles();
251 -
252 232 Plugin::$instance->widgets_manager->enqueue_widgets_styles();
253 233
254 - $suffix = Utils::is_script_debug() ? '' : '.min';
234 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
255 235
256 236 $direction_suffix = is_rtl() ? '-rtl' : '';
257 237
258 238 wp_register_style(
@@ -270,17 +250,21 @@
270 250 ],
271 251 ELEMENTOR_VERSION
272 252 );
273 253
274 - wp_enqueue_style(
275 - 'e-theme-ui-light',
276 - $this->get_css_assets_url( 'theme-light' ),
277 - [],
278 - ELEMENTOR_VERSION
279 - );
254 + wp_enqueue_style( 'editor-preview' );
280 255
281 - 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 + );
282 263
264 + wp_enqueue_style( 'editor-preview-legacy' );
265 + }
266 +
283 267 // Handle the 'wp audio' in editor preview.
284 268 wp_enqueue_style( 'wp-mediaelement' );
285 269
286 270 /**
@@ -306,11 +290,10 @@
306 290 private function enqueue_scripts() {
307 291 Plugin::$instance->frontend->register_scripts();
308 292
309 293 Plugin::$instance->widgets_manager->enqueue_widgets_scripts();
310 - Plugin::$instance->elements_manager->enqueue_elements_scripts();
311 294
312 - $suffix = Utils::is_script_debug() ? '' : '.min';
295 + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
313 296
314 297 wp_enqueue_script(
315 298 'elementor-inline-editor',
316 299 ELEMENTOR_ASSETS_URL . 'lib/inline-editor/js/inline-editor' . $suffix . '.js',