| @@ -22,8 +22,9 @@ | ||
| 22 | 22 | use Elementor\App\Modules\KitLibrary\Module as KitLibraryModule; |
| 23 | 23 | use Elementor\App\Modules\ImportExportCustomization\Module as ImportExportCustomizationModule; |
| 24 | 24 | use Elementor\App\Modules\SiteEditor\Module as SiteEditorModule; |
| 25 | 25 | use Elementor\App\Modules\Onboarding\Module as OnboardingModule; |
| 26 | +use Elementor\App\Modules\OnboardingNew\Module as OnboardingNewModule; | |
| 26 | 27 | |
| 27 | 28 | if ( ! defined( 'ABSPATH' ) ) { |
| 28 | 29 | exit; // Exit if accessed directly. |
| 29 | 30 | } |
| @@ -297,8 +298,22 @@ | ||
| 297 | 298 | 'mutable' => false, |
| 298 | 299 | ] ); |
| 299 | 300 | } |
| 300 | 301 | |
| 302 | + private function register_e_onboarding_experiment() { | |
| 303 | + Plugin::$instance->experiments->add_feature( [ | |
| 304 | + 'name' => 'e_onboarding', | |
| 305 | + 'title' => esc_html__( 'New Onboarding', 'elementor' ), | |
| 306 | + 'hidden' => true, | |
| 307 | + 'default' => ExperimentsManager::STATE_INACTIVE, | |
| 308 | + 'release_status' => ExperimentsManager::RELEASE_STATUS_DEV, | |
| 309 | + ] ); | |
| 310 | + } | |
| 311 | + | |
| 312 | + private function is_e_onboarding_active(): bool { | |
| 313 | + return Plugin::$instance->experiments->is_feature_active( 'e_onboarding' ); | |
| 314 | + } | |
| 315 | + | |
| 301 | 316 | public function __construct() { |
| 302 | 317 | $this->register_import_export_customization_experiment(); |
| 303 | 318 | |
| 304 | 319 | $this->add_component( 'site-editor', new SiteEditorModule() ); |
| @@ -313,9 +328,15 @@ | ||
| 313 | 328 | // Kit library is depended on import-export |
| 314 | 329 | $this->add_component( 'kit-library', new KitLibraryModule() ); |
| 315 | 330 | } |
| 316 | 331 | |
| 317 | - $this->add_component( 'onboarding', new OnboardingModule() ); | |
| 332 | + $this->register_e_onboarding_experiment(); | |
| 333 | + | |
| 334 | + if ( $this->is_e_onboarding_active() ) { | |
| 335 | + $this->add_component( 'onboarding', new OnboardingNewModule() ); | |
| 336 | + } else { | |
| 337 | + $this->add_component( 'onboarding', new OnboardingModule() ); | |
| 338 | + } | |
| 318 | 339 | |
| 319 | 340 | add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) { |
| 320 | 341 | $this->register_editor_one_menu( $menu_data_provider ); |
| 321 | 342 | } ); |