PluginProbe
Elementor Website Builder – more than just a page builder / 3.26.4
Elementor Website Builder – more than just a page builder v3.26.4
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 4.0.7 All 451 releases
elementor / app / modules / onboarding / features-usage.php

features-usage.php in Elementor Website Builder – more than just a page builder 3.26.4, at app/modules/onboarding/features-usage.php

50 lines 995 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\App\Modules\Onboarding;
4
5 use Elementor\Tracker;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly
9 }
10
11 class Features_Usage {
12
13 const ONBOARDING_FEATURES_OPTION = '_elementor_onboarding_features';
14
15 public function register() {
16 if ( ! Tracker::is_allow_track() ) {
17 return;
18 }
19
20 add_filter( 'elementor/tracker/send_tracking_data_params', function ( array $params ) {
21 $params['usages']['onboarding_features'] = $this->get_usage_data();
22
23 return $params;
24 } );
25 }
26
27 public function save_onboarding_features( $raw_post_data ) {
28 if ( empty( $raw_post_data ) ) {
29 return;
30 }
31
32 $post_data = json_decode( $raw_post_data, true );
33
34 if ( empty( $post_data['features'] ) ) {
35 return;
36 }
37
38 update_option( static::ONBOARDING_FEATURES_OPTION, $post_data['features'] );
39
40 return [
41 'status' => 'success',
42 'payload' => [],
43 ];
44 }
45
46 private function get_usage_data() {
47 return get_option( static::ONBOARDING_FEATURES_OPTION, [] );
48 }
49 }
50