| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | use Elementor\Modules\GlobalClasses\Module as GlobalClassesModule; |
| 8 | 8 | use Elementor\Modules\NestedElements\Module as NestedElementsModule; |
| 9 | 9 | use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule; |
| 10 | 10 | use Elementor\Modules\Variables\Module as VariablesModule; |
| 11 | -use Elementor\Modules\Components\Module as ComponentsModule; | |
| 12 | 11 | use Elementor\Plugin; |
| 13 | 12 | |
| 14 | 13 | class Opt_In { |
| 15 | 14 | const EXPERIMENT_NAME = 'e_opt_in_v4'; |
| @@ -18,9 +17,8 @@ | ||
| 18 | 17 | self::EXPERIMENT_NAME, |
| 19 | 18 | AtomicWidgetsModule::EXPERIMENT_NAME, |
| 20 | 19 | GlobalClassesModule::NAME, |
| 21 | 20 | VariablesModule::EXPERIMENT_NAME, |
| 22 | - ComponentsModule::EXPERIMENT_NAME, | |
| 23 | 21 | ]; |
| 24 | 22 | |
| 25 | 23 | const OPT_IN_FEATURES = [ |
| 26 | 24 | self::EXPERIMENT_NAME, |
| @@ -28,9 +26,8 @@ | ||
| 28 | 26 | NestedElementsModule::EXPERIMENT_NAME, |
| 29 | 27 | AtomicWidgetsModule::EXPERIMENT_NAME, |
| 30 | 28 | GlobalClassesModule::NAME, |
| 31 | 29 | VariablesModule::EXPERIMENT_NAME, |
| 32 | - ComponentsModule::EXPERIMENT_NAME, | |
| 33 | 30 | ]; |
| 34 | 31 | |
| 35 | 32 | public function init() { |
| 36 | 33 | $this->register_feature(); |
| @@ -35,9 +32,8 @@ | ||
| 35 | 32 | public function init() { |
| 36 | 33 | $this->register_feature(); |
| 37 | 34 | |
| 38 | 35 | add_action( 'elementor/ajax/register_actions', fn( Ajax $ajax ) => $this->add_ajax_actions( $ajax ) ); |
| 39 | - add_action( 'rest_api_init', fn() => $this->register_routes() ); | |
| 40 | 36 | } |
| 41 | 37 | |
| 42 | 38 | private function register_feature() { |
| 43 | 39 | Plugin::$instance->experiments->add_feature([ |
| @@ -46,12 +42,8 @@ | ||
| 46 | 42 | 'description' => esc_html__( 'Enable Editor V4.', 'elementor' ), |
| 47 | 43 | 'hidden' => true, |
| 48 | 44 | 'default' => Experiments_Manager::STATE_INACTIVE, |
| 49 | 45 | 'release_status' => Experiments_Manager::RELEASE_STATUS_ALPHA, |
| 50 | - 'new_site' => [ | |
| 51 | - 'default_active' => true, | |
| 52 | - 'minimum_installation_version' => '4.0.0', | |
| 53 | - ], | |
| 54 | 46 | ]); |
| 55 | 47 | } |
| 56 | 48 | |
| 57 | 49 | private function opt_out_v4() { |
| @@ -86,21 +78,6 @@ | ||
| 86 | 78 | |
| 87 | 79 | private function add_ajax_actions( Ajax $ajax ) { |
| 88 | 80 | $ajax->register_ajax_action( 'editor_v4_opt_in', fn() => $this->ajax_opt_in_v4() ); |
| 89 | 81 | $ajax->register_ajax_action( 'editor_v4_opt_out', fn() => $this->ajax_opt_out_v4() ); |
| 90 | - } | |
| 91 | - | |
| 92 | - private function handle_rest_opt_in_v4() { | |
| 93 | - $this->ajax_opt_in_v4(); | |
| 94 | - return new \WP_REST_Response( [ | |
| 95 | - 'success' => true, | |
| 96 | - ], 200 ); | |
| 97 | - } | |
| 98 | - | |
| 99 | - private function register_routes() { | |
| 100 | - register_rest_route( 'elementor/v1', '/operations/opt-in-v4', [ | |
| 101 | - 'methods' => 'POST', | |
| 102 | - 'callback' => fn() => $this->handle_rest_opt_in_v4(), | |
| 103 | - 'permission_callback' => fn() => current_user_can( 'manage_options' ), | |
| 104 | - ] ); | |
| 105 | 82 | } |
| 106 | 83 | } |