| @@ -1,17 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Modules\Variables; |
| 4 | 4 | |
| 5 | -use Elementor\Modules\Variables\Adapters\Prop_Type_Adapter; | |
| 6 | 5 | use Elementor\Modules\Variables\Classes\Variable_Types_Registry; |
| 7 | 6 | use Elementor\Modules\Variables\PropTypes\Color_Variable_Prop_Type; |
| 8 | 7 | use Elementor\Modules\Variables\PropTypes\Font_Variable_Prop_Type; |
| 9 | -use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type; | |
| 10 | 8 | use Elementor\Modules\Variables\Services\Batch_Operations\Batch_Processor; |
| 11 | 9 | use Elementor\Modules\Variables\Services\Variables_Service; |
| 12 | 10 | use Elementor\Modules\Variables\Storage\Variables_Repository; |
| 13 | -use Elementor\Modules\Variables\Utils\Template_Library_Variables; | |
| 14 | 11 | use Elementor\Plugin; |
| 15 | 12 | use Elementor\Core\Files\CSS\Post as Post_CSS; |
| 16 | 13 | use Elementor\Modules\Variables\Classes\CSS_Renderer as Variables_CSS_Renderer; |
| 17 | 14 | use Elementor\Modules\Variables\Classes\Fonts; |
| @@ -16,14 +13,13 @@ | ||
| 16 | 13 | use Elementor\Modules\Variables\Classes\CSS_Renderer as Variables_CSS_Renderer; |
| 17 | 14 | use Elementor\Modules\Variables\Classes\Fonts; |
| 18 | 15 | use Elementor\Modules\Variables\Classes\Rest_Api as Variables_API; |
| 19 | 16 | use Elementor\Modules\Variables\Classes\Style_Schema; |
| 20 | -use Elementor\Modules\Variables\Classes\Size_Style_Schema; | |
| 21 | 17 | use Elementor\Modules\Variables\Classes\Style_Transformers; |
| 22 | 18 | use Elementor\Modules\Variables\Classes\Variables; |
| 23 | 19 | |
| 24 | 20 | if ( ! defined( 'ABSPATH' ) ) { |
| 25 | - exit; | |
| 21 | + exit; // Exit if accessed directly. | |
| 26 | 22 | } |
| 27 | 23 | |
| 28 | 24 | class Hooks { |
| 29 | 25 | const PACKAGES = [ |
| @@ -31,15 +27,14 @@ | ||
| 31 | 27 | ]; |
| 32 | 28 | |
| 33 | 29 | public function register() { |
| 34 | 30 | $this->register_styles_transformers() |
| 31 | + ->register_packages() | |
| 32 | + ->filter_for_style_schema() | |
| 35 | 33 | ->register_css_renderer() |
| 36 | - ->register_packages() | |
| 37 | 34 | ->register_fonts() |
| 38 | 35 | ->register_api_endpoints() |
| 39 | - ->filter_for_style_schema() | |
| 40 | - ->register_variable_types() | |
| 41 | - ->register_template_library_import(); | |
| 36 | + ->register_variable_types(); | |
| 42 | 37 | |
| 43 | 38 | return $this; |
| 44 | 39 | } |
| 45 | 40 | |
| @@ -46,10 +41,8 @@ | ||
| 46 | 41 | private function register_variable_types() { |
| 47 | 42 | add_action( 'elementor/variables/register', function ( Variable_Types_Registry $registry ) { |
| 48 | 43 | $registry->register( Color_Variable_Prop_Type::get_key(), new Color_Variable_Prop_Type() ); |
| 49 | 44 | $registry->register( Font_Variable_Prop_Type::get_key(), new Font_Variable_Prop_Type() ); |
| 50 | - $registry->register( Prop_Type_Adapter::GLOBAL_CUSTOM_SIZE_VARIABLE_KEY, new Size_Variable_Prop_Type() ); | |
| 51 | - $registry->register( Size_Variable_Prop_Type::get_key(), new Size_Variable_Prop_Type() ); | |
| 52 | 45 | } ); |
| 53 | 46 | |
| 54 | 47 | return $this; |
| 55 | 48 | } |
| @@ -75,12 +68,8 @@ | ||
| 75 | 68 | add_filter( 'elementor/atomic-widgets/styles/schema', function ( array $schema ) { |
| 76 | 69 | return ( new Style_Schema() )->augment( $schema ); |
| 77 | 70 | } ); |
| 78 | 71 | |
| 79 | - add_filter( 'elementor/atomic-widgets/styles/schema', function ( array $schema ) { | |
| 80 | - return ( new Size_Style_Schema() )->augment( $schema ); | |
| 81 | - } ); | |
| 82 | - | |
| 83 | 72 | return $this; |
| 84 | 73 | } |
| 85 | 74 | |
| 86 | 75 | private function css_renderer() { |
| @@ -130,38 +119,6 @@ | ||
| 130 | 119 | Plugin::$instance->kits_manager->get_active_kit() |
| 131 | 120 | ); |
| 132 | 121 | |
| 133 | 122 | return new Variables_Service( $repository, new Batch_Processor() ); |
| 134 | - } | |
| 135 | - | |
| 136 | - private function register_template_library_import() { | |
| 137 | - add_filter( | |
| 138 | - 'elementor/template_library/export/build_snapshots', | |
| 139 | - [ Template_Library_Variables::class, 'add_variables_snapshot' ], | |
| 140 | - 20, | |
| 141 | - 4 | |
| 142 | - ); | |
| 143 | - | |
| 144 | - add_filter( | |
| 145 | - 'elementor/template_library/get_data/extract_snapshots', | |
| 146 | - [ Template_Library_Variables::class, 'extract_variables_from_data' ], | |
| 147 | - 10, | |
| 148 | - 3 | |
| 149 | - ); | |
| 150 | - | |
| 151 | - add_filter( | |
| 152 | - 'elementor/template_library/import/process_content', | |
| 153 | - [ Template_Library_Variables::class, 'process_variables_import' ], | |
| 154 | - 10, | |
| 155 | - 3 | |
| 156 | - ); | |
| 157 | - | |
| 158 | - add_filter( | |
| 159 | - 'elementor/global_classes/import/transform_snapshot', | |
| 160 | - [ Template_Library_Variables::class, 'transform_variables_in_classes_snapshot' ], | |
| 161 | - 10, | |
| 162 | - 4 | |
| 163 | - ); | |
| 164 | - | |
| 165 | - return $this; | |
| 166 | 123 | } |
| 167 | 124 | } |