| @@ -18,13 +18,8 @@ | ||
| 18 | 18 | */ |
| 19 | 19 | class Preview extends App { |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * The priority of the preview enqueued styles. | |
| 23 | - */ | |
| 24 | - const ENQUEUED_STYLES_PRIORITY = 20; | |
| 25 | - | |
| 26 | - /** | |
| 27 | 22 | * Is Preview. |
| 28 | 23 | * |
| 29 | 24 | * Holds a flag if current request is a preview. |
| 30 | 25 | * The flag is not related to a specific post or edit permissions. |
| @@ -107,9 +102,9 @@ | ||
| 107 | 102 | |
| 108 | 103 | add_action( 'wp_enqueue_scripts', function() { |
| 109 | 104 | $this->enqueue_styles(); |
| 110 | 105 | $this->enqueue_scripts(); |
| 111 | - }, self::ENQUEUED_STYLES_PRIORITY ); | |
| 106 | + } ); | |
| 112 | 107 | |
| 113 | 108 | add_filter( 'the_content', [ $this, 'builder_wrapper' ], 999999 ); |
| 114 | 109 | |
| 115 | 110 | add_action( 'wp_footer', [ $this, 'wp_footer' ] ); |
| @@ -234,13 +229,11 @@ | ||
| 234 | 229 | wp_add_inline_script( 'jquery-migrate', 'jQuery.holdReady( true );' ); |
| 235 | 230 | |
| 236 | 231 | Plugin::$instance->frontend->enqueue_styles(); |
| 237 | 232 | |
| 238 | - Plugin::$instance->elements_manager->enqueue_elements_styles(); | |
| 239 | - | |
| 240 | 233 | Plugin::$instance->widgets_manager->enqueue_widgets_styles(); |
| 241 | 234 | |
| 242 | - $suffix = Utils::is_script_debug() ? '' : '.min'; | |
| 235 | + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
| 243 | 236 | |
| 244 | 237 | $direction_suffix = is_rtl() ? '-rtl' : ''; |
| 245 | 238 | |
| 246 | 239 | wp_register_style( |
| @@ -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', |