PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.0-beta1
Elementor Website Builder – more than just a page builder v3.34.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | modules/atomic-widgets/opt-in/opt-in.php +11 -24 4.3.0-beta2 → 3.34.0-beta1 View file →
@@ -3,31 +3,37 @@
3 3 namespace Elementor\Modules\AtomicWidgets\OptIn;
4 4
5 5 use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
6 6 use Elementor\Core\Experiments\Manager as Experiments_Manager;
7 +use Elementor\Modules\GlobalClasses\Module as GlobalClassesModule;
8 +use Elementor\Modules\NestedElements\Module as NestedElementsModule;
7 9 use Elementor\Modules\AtomicWidgets\Module as AtomicWidgetsModule;
10 +use Elementor\Modules\Variables\Module as VariablesModule;
8 11 use Elementor\Plugin;
9 12
10 13 class Opt_In {
11 14 const EXPERIMENT_NAME = 'e_opt_in_v4';
12 15
13 - const OPT_IN_FEATURES = [
16 + const OPT_OUT_FEATURES = [
14 17 self::EXPERIMENT_NAME,
15 - 'container',
16 18 AtomicWidgetsModule::EXPERIMENT_NAME,
19 + GlobalClassesModule::NAME,
20 + VariablesModule::EXPERIMENT_NAME,
17 21 ];
18 22
19 - const OPT_OUT_FEATURES = [
23 + const OPT_IN_FEATURES = [
20 24 self::EXPERIMENT_NAME,
25 + 'container',
26 + NestedElementsModule::EXPERIMENT_NAME,
21 27 AtomicWidgetsModule::EXPERIMENT_NAME,
28 + GlobalClassesModule::NAME,
29 + VariablesModule::EXPERIMENT_NAME,
22 30 ];
23 31
24 -
25 32 public function init() {
26 33 $this->register_feature();
27 34
28 35 add_action( 'elementor/ajax/register_actions', fn( Ajax $ajax ) => $this->add_ajax_actions( $ajax ) );
29 - add_action( 'rest_api_init', fn() => $this->register_routes() );
30 36 }
31 37
32 38 private function register_feature() {
33 39 Plugin::$instance->experiments->add_feature([
@@ -36,12 +42,8 @@
36 42 'description' => esc_html__( 'Enable Editor V4.', 'elementor' ),
37 43 'hidden' => true,
38 44 'default' => Experiments_Manager::STATE_INACTIVE,
39 45 'release_status' => Experiments_Manager::RELEASE_STATUS_ALPHA,
40 - 'new_site' => [
41 - 'default_active' => true,
42 - 'minimum_installation_version' => '4.0.0',
43 - ],
44 46 ]);
45 47 }
46 48
47 49 private function opt_out_v4() {
@@ -76,21 +78,6 @@
76 78
77 79 private function add_ajax_actions( Ajax $ajax ) {
78 80 $ajax->register_ajax_action( 'editor_v4_opt_in', fn() => $this->ajax_opt_in_v4() );
79 81 $ajax->register_ajax_action( 'editor_v4_opt_out', fn() => $this->ajax_opt_out_v4() );
80 - }
81 -
82 - private function handle_rest_opt_in_v4() {
83 - $this->ajax_opt_in_v4();
84 - return new \WP_REST_Response( [
85 - 'success' => true,
86 - ], 200 );
87 - }
88 -
89 - private function register_routes() {
90 - register_rest_route( 'elementor/v1', '/operations/opt-in-v4', [
91 - 'methods' => 'POST',
92 - 'callback' => fn() => $this->handle_rest_opt_in_v4(),
93 - 'permission_callback' => fn() => current_user_can( 'manage_options' ),
94 - ] );
95 82 }
96 83 }