| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Core\Base\App; |
| 5 | -use Elementor\Core\Editor\Editor; | |
| 6 | 5 | use Elementor\Core\Settings\Manager as SettingsManager; |
| 7 | 6 | |
| 8 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 8 | exit; // Exit if accessed directly. |
| @@ -93,13 +92,8 @@ | ||
| 93 | 92 | |
| 94 | 93 | $this->post_id = get_the_ID(); |
| 95 | 94 | $this->is_preview = true; |
| 96 | 95 | |
| 97 | - // Send Document-Isolation-Policy on the preview iframe so it shares | |
| 98 | - // an agent cluster with the editor parent and synchronous DOM access | |
| 99 | - // (e.g. iframe.contentWindow.elementorFrontend) keeps working. | |
| 100 | - Editor::send_document_isolation_policy_header(); | |
| 101 | - | |
| 102 | 96 | // Don't redirect to permalink. |
| 103 | 97 | remove_action( 'template_redirect', 'redirect_canonical' ); |
| 104 | 98 | |
| 105 | 99 | // Compatibility with Yoast SEO plugin when 'Removes unneeded query variables from the URL' enabled. |
| @@ -200,20 +194,8 @@ | ||
| 200 | 194 | return true; |
| 201 | 195 | } |
| 202 | 196 | |
| 203 | 197 | /** |
| 204 | - * Whether WordPress post preview or Elementor preview iframe is active. | |
| 205 | - * | |
| 206 | - * @since 4.1.0 | |
| 207 | - * @access public | |
| 208 | - * | |
| 209 | - * @return bool | |
| 210 | - */ | |
| 211 | - public function is_editor_or_preview() { | |
| 212 | - return is_preview() || $this->is_preview_mode(); | |
| 213 | - } | |
| 214 | - | |
| 215 | - /** | |
| 216 | 198 | * Builder wrapper. |
| 217 | 199 | * |
| 218 | 200 | * Used to add an empty HTML wrapper for the builder, the javascript will add |
| 219 | 201 | * the content later. |
| @@ -252,13 +234,11 @@ | ||
| 252 | 234 | wp_add_inline_script( 'jquery-migrate', 'jQuery.holdReady( true );' ); |
| 253 | 235 | |
| 254 | 236 | Plugin::$instance->frontend->enqueue_styles(); |
| 255 | 237 | |
| 256 | - Plugin::$instance->elements_manager->enqueue_elements_styles(); | |
| 257 | - | |
| 258 | 238 | Plugin::$instance->widgets_manager->enqueue_widgets_styles(); |
| 259 | 239 | |
| 260 | - $suffix = Utils::is_script_debug() ? '' : '.min'; | |
| 240 | + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
| 261 | 241 | |
| 262 | 242 | $direction_suffix = is_rtl() ? '-rtl' : ''; |
| 263 | 243 | |
| 264 | 244 | wp_register_style( |
| @@ -312,11 +292,10 @@ | ||
| 312 | 292 | private function enqueue_scripts() { |
| 313 | 293 | Plugin::$instance->frontend->register_scripts(); |
| 314 | 294 | |
| 315 | 295 | Plugin::$instance->widgets_manager->enqueue_widgets_scripts(); |
| 316 | - Plugin::$instance->elements_manager->enqueue_elements_scripts(); | |
| 317 | 296 | |
| 318 | - $suffix = Utils::is_script_debug() ? '' : '.min'; | |
| 297 | + $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; | |
| 319 | 298 | |
| 320 | 299 | wp_enqueue_script( |
| 321 | 300 | 'elementor-inline-editor', |
| 322 | 301 | ELEMENTOR_ASSETS_URL . 'lib/inline-editor/js/inline-editor' . $suffix . '.js', |