← All changes
|
modules/atomic-widgets/opt-in/opt-in.php
+0
-20
4.2.0-beta2
→
3.35.0-dev2
View file →
| @@ -35,9 +35,8 @@ | ||
| 35 | 35 | public function init() { |
| 36 | 36 | $this->register_feature(); |
| 37 | 37 | |
| 38 | 38 | 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 | 39 | } |
| 41 | 40 | |
| 42 | 41 | private function register_feature() { |
| 43 | 42 | Plugin::$instance->experiments->add_feature([ |
| @@ -46,12 +45,8 @@ | ||
| 46 | 45 | 'description' => esc_html__( 'Enable Editor V4.', 'elementor' ), |
| 47 | 46 | 'hidden' => true, |
| 48 | 47 | 'default' => Experiments_Manager::STATE_INACTIVE, |
| 49 | 48 | 'release_status' => Experiments_Manager::RELEASE_STATUS_ALPHA, |
| 50 | - 'new_site' => [ | |
| 51 | - 'default_active' => true, | |
| 52 | - 'minimum_installation_version' => '4.0.0', | |
| 53 | - ], | |
| 54 | 49 | ]); |
| 55 | 50 | } |
| 56 | 51 | |
| 57 | 52 | private function opt_out_v4() { |
| @@ -86,21 +81,6 @@ | ||
| 86 | 81 | |
| 87 | 82 | private function add_ajax_actions( Ajax $ajax ) { |
| 88 | 83 | $ajax->register_ajax_action( 'editor_v4_opt_in', fn() => $this->ajax_opt_in_v4() ); |
| 89 | 84 | $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 | 85 | } |
| 106 | 86 | } |