PluginProbe
Elementor Website Builder – more than just a page builder / 3.27.4
Elementor Website Builder – more than just a page builder v3.27.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
← All changes | modules/home/classes/transformations-manager.php +14 -10 4.2.0-dev23.27.4 View file →
@@ -2,12 +2,13 @@
2 2 namespace Elementor\Modules\Home\Classes;
3 3
4 4 use Elementor\Core\Isolation\Wordpress_Adapter;
5 5 use Elementor\Core\Isolation\Plugin_Status_Adapter;
6 -use Elementor\Includes\EditorAssetsAPI;
6 +use Elementor\Core\Isolation\Wordpress_Adapter_Interface;
7 +use Elementor\Plugin;
7 8
8 9 if ( ! defined( 'ABSPATH' ) ) {
9 - exit; // Exit if accessed directly.
10 + exit; // Exit if accessed directly
10 11 }
11 12
12 13 class Transformations_Manager {
13 14
@@ -14,19 +15,19 @@
14 15 private static $cached_data = [];
15 16
16 17 private const TRANSFORMATIONS = [
17 18 'Create_New_Page_Url',
18 - 'Create_Edit_Website_Url',
19 + 'Filter_Plugins',
19 20 'Filter_Get_Started_By_License',
20 21 'Filter_Sidebar_Promotion_By_License',
22 + 'Filter_Condition_Introduction_Meta',
21 23 'Create_Site_Settings_Url',
22 24 'Filter_Top_Section_By_License',
23 - 'Site_Builder_Config',
24 25 ];
25 26
26 27 protected array $home_screen_data;
27 28
28 - protected Wordpress_Adapter $wordpress_adapter;
29 + protected Wordpress_Adapter_Interface $wordpress_adapter;
29 30
30 31 protected Plugin_Status_Adapter $plugin_status_adapter;
31 32
32 33 protected array $transformation_classes = [];
@@ -31,19 +32,22 @@
31 32
32 33 protected array $transformation_classes = [];
33 34
34 35 public function __construct( $home_screen_data ) {
36 + $container = Plugin::$instance->elementor_container();
37 +
38 + if ( $container->has( Wordpress_Adapter::class ) ) {
39 + $this->wordpress_adapter = $container->get( Wordpress_Adapter::class );
40 + } else {
41 + $this->wordpress_adapter = new Wordpress_Adapter();
42 + }
43 +
35 44 $this->home_screen_data = $home_screen_data;
36 - $this->wordpress_adapter = new Wordpress_Adapter();
37 45 $this->plugin_status_adapter = new Plugin_Status_Adapter( $this->wordpress_adapter );
38 46 $this->transformation_classes = $this->get_transformation_classes();
39 47 }
40 48
41 49 public function run_transformations(): array {
42 - if ( ! EditorAssetsAPI::is_valid_data( $this->home_screen_data ) ) {
43 - return [];
44 - }
45 -
46 50 if ( ! empty( self::$cached_data ) ) {
47 51 return self::$cached_data;
48 52 }
49 53