| @@ -5,13 +5,15 @@ | ||
| 5 | 5 | use Elementor\Core\Common\Modules\Ajax\Module; |
| 6 | 6 | use Elementor\Core\Debug\Loading_Inspection_Manager; |
| 7 | 7 | use Elementor\Core\Editor\Loader\Editor_Loader_Factory; |
| 8 | 8 | use Elementor\Core\Editor\Loader\Editor_Loader_Interface; |
| 9 | +use Elementor\Core\Experiments\Manager as Experiments_Manager; | |
| 9 | 10 | use Elementor\Core\Settings\Manager as SettingsManager; |
| 10 | 11 | use Elementor\Plugin; |
| 11 | 12 | use Elementor\TemplateLibrary\Source_Local; |
| 12 | 13 | use Elementor\Utils; |
| 13 | 14 | use Elementor\Core\Editor\Data; |
| 15 | +use Elementor\Modules\EditorAppBar\Module as App_Bar_Module; | |
| 14 | 16 | |
| 15 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 16 | 18 | exit; // Exit if accessed directly. |
| 17 | 19 | } |
| @@ -31,8 +33,15 @@ | ||
| 31 | 33 | */ |
| 32 | 34 | const EDITING_CAPABILITY = 'edit_posts'; |
| 33 | 35 | |
| 34 | 36 | /** |
| 37 | + * The const is deprecated, it remains here for backward compatibility. | |
| 38 | + * | |
| 39 | + * @deprecated Use App_Bar_Module::EXPERIMENT_NAME instead | |
| 40 | + */ | |
| 41 | + const EDITOR_V2_EXPERIMENT_NAME = App_Bar_Module::EXPERIMENT_NAME; | |
| 42 | + | |
| 43 | + /** | |
| 35 | 44 | * Post ID. |
| 36 | 45 | * |
| 37 | 46 | * Holds the ID of the current post being edited. |
| 38 | 47 | * |
| @@ -80,11 +89,11 @@ | ||
| 80 | 89 | * |
| 81 | 90 | * @since 1.0.0 |
| 82 | 91 | * @access public |
| 83 | 92 | * |
| 84 | - * @param bool $to_die Optional. Whether to die at the end. Default is `true`. | |
| 93 | + * @param bool $die Optional. Whether to die at the end. Default is `true`. | |
| 85 | 94 | */ |
| 86 | - public function init( $to_die = true ) { | |
| 95 | + public function init( $die = true ) { | |
| 87 | 96 | if ( empty( $_REQUEST['post'] ) ) { |
| 88 | 97 | return; |
| 89 | 98 | } |
| 90 | 99 | |
| @@ -159,9 +168,9 @@ | ||
| 159 | 168 | |
| 160 | 169 | $this->get_loader()->print_root_template(); |
| 161 | 170 | |
| 162 | 171 | // From the action it's an empty string, from tests its `false` |
| 163 | - if ( false !== $to_die ) { | |
| 172 | + if ( false !== $die ) { | |
| 164 | 173 | die; |
| 165 | 174 | } |
| 166 | 175 | } |
| 167 | 176 | |
| @@ -537,28 +546,8 @@ | ||
| 537 | 546 | |
| 538 | 547 | // Handle autocomplete feature for URL control. |
| 539 | 548 | add_filter( 'wp_link_query_args', [ $this, 'filter_wp_link_query_args' ] ); |
| 540 | 549 | add_filter( 'wp_link_query', [ $this, 'filter_wp_link_query' ] ); |
| 541 | - | |
| 542 | - add_filter( 'replace_editor', [ $this, 'filter_replace_editor' ], 10, 2 ); | |
| 543 | - } | |
| 544 | - | |
| 545 | - /** | |
| 546 | - * Signals to WordPress that Elementor is replacing the block editor on its own editor page, | |
| 547 | - * so that block-editor-specific behaviour (e.g. WP 7.0 COOP/COEP isolation headers) is not | |
| 548 | - * applied when the Elementor editor is active. | |
| 549 | - * | |
| 550 | - * @param bool $replace Whether the editor is being replaced. | |
| 551 | - * @param \WP_Post $post The post being edited. | |
| 552 | - * | |
| 553 | - * @return bool | |
| 554 | - */ | |
| 555 | - public function filter_replace_editor( $replace, $post ) { | |
| 556 | - if ( isset( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 557 | - return true; | |
| 558 | - } | |
| 559 | - | |
| 560 | - return $replace; | |
| 561 | 550 | } |
| 562 | 551 | |
| 563 | 552 | /** |
| 564 | 553 | * @since 2.2.0 |