PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.4
Elementor Website Builder – more than just a page builder v4.2.4
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 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | app/modules/onboarding/module.php +40 -0 4.3.0-beta24.2.4 View file →
@@ -50,8 +50,15 @@
50 50
51 51 Plugin::instance()->data_manager_v2->register_controller( new Controller() );
52 52
53 53 add_action( 'elementor/init', [ $this, 'on_elementor_init' ], 12 );
54 +
55 + if ( $this->should_show_starter() ) {
56 + add_filter( 'elementor/editor/localize_settings', [ $this, 'add_starter_settings' ] );
57 + add_filter( 'elementor/editor/v2/packages', [ $this, 'add_starter_packages' ] );
58 + add_action( 'elementor/editor/v2/styles/enqueue', [ $this, 'enqueue_fonts' ] );
59 + add_action( 'elementor/preview/enqueue_styles', [ $this, 'enqueue_starter_preview_css' ] );
60 + }
54 61 }
55 62
56 63 public function on_elementor_init(): void {
57 64 if ( ! Plugin::instance()->app->is_current() ) {
@@ -70,8 +77,19 @@
70 77 ELEMENTOR_VERSION
71 78 );
72 79 }
73 80
81 + public function enqueue_starter_preview_css(): void {
82 + $css = '
83 + #site-header,
84 + .page-header { display: var(--e-starter-header-display, none); }
85 + ';
86 +
87 + wp_register_style( 'elementor-starter-preview', false );
88 + wp_enqueue_style( 'elementor-starter-preview' );
89 + wp_add_inline_style( 'elementor-starter-preview', $css );
90 + }
91 +
74 92 public function progress_manager(): Onboarding_Progress_Manager {
75 93 return $this->progress_manager;
76 94 }
77 95
@@ -214,8 +232,30 @@
214 232
215 233 $user = $library->get( 'user' );
216 234
217 235 return $user->first_name ?? '';
236 + }
237 +
238 + public function should_show_starter(): bool {
239 + $progress = $this->progress_manager->get_progress();
240 +
241 + return self::VERSION === get_option( self::ONBOARDING_OPTION ) && ! $progress->is_starter_dismissed();
242 + }
243 +
244 + public function add_starter_packages( array $packages ): array {
245 + $packages[] = 'editor-starter';
246 +
247 + return $packages;
248 + }
249 +
250 + public function add_starter_settings( array $settings ): array {
251 + $settings['starter'] = [
252 + 'restPath' => 'elementor/v1/onboarding/user-progress',
253 + 'aiPlannerUrl' => 'https://planner.elementor.com/home.html',
254 + 'kitLibraryUrl' => Plugin::$instance->app->get_base_url() . '#/kit-library',
255 + ];
256 +
257 + return $settings;
218 258 }
219 259
220 260 private function maybe_invalidate_theme_selection( User_Progress $progress, User_Choices $choices ): void {
221 261 $selected_theme = $choices->get_theme_selection();