| @@ -5,10 +5,8 @@ | ||
| 5 | 5 | use Elementor\Core\Utils\Api\Parse_Result; |
| 6 | 6 | use Elementor\Modules\Components\OverridableProps\Component_Overridable_Props_Parser; |
| 7 | 7 | use Elementor\Modules\Components\PropTypes\Override_Prop_Type; |
| 8 | 8 | use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type; |
| 9 | -use Elementor\Modules\Components\Variants\Component_Variants; | |
| 10 | -use Elementor\Modules\Components\Variants\Component_Variants_Parser; | |
| 11 | 9 | use Elementor\Modules\Components\Widgets\Component_Instance; |
| 12 | 10 | |
| 13 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | 12 | exit; // Exit if accessed directly |
| @@ -17,15 +15,13 @@ | ||
| 17 | 15 | class Component extends Document { |
| 18 | 16 | const TYPE = 'elementor_component'; |
| 19 | 17 | const COMPONENT_UID_META_KEY = '_elementor_component_uid'; |
| 20 | 18 | const OVERRIDABLE_PROPS_META_KEY = '_elementor_component_overridable_props'; |
| 21 | - const VARIANTS_META_KEY = '_elementor_component_variants'; | |
| 22 | 19 | const ARCHIVED_META_KEY = '_elementor_component_is_archived'; |
| 23 | 20 | const ARCHIVED_AT_META_KEY = '_elementor_component_archived_at'; |
| 24 | 21 | const COMPONENT_CUSTOM_META_KEYS = [ |
| 25 | 22 | self::COMPONENT_UID_META_KEY, |
| 26 | 23 | self::OVERRIDABLE_PROPS_META_KEY, |
| 27 | - self::VARIANTS_META_KEY, | |
| 28 | 24 | self::ARCHIVED_META_KEY, |
| 29 | 25 | self::ARCHIVED_AT_META_KEY, |
| 30 | 26 | ]; |
| 31 | 27 | |
| @@ -110,30 +106,8 @@ | ||
| 110 | 106 | |
| 111 | 107 | $sanitized_data = $result->unwrap(); |
| 112 | 108 | |
| 113 | 109 | $this->update_json_meta( self::OVERRIDABLE_PROPS_META_KEY, $sanitized_data ); |
| 114 | - | |
| 115 | - return $result; | |
| 116 | - } | |
| 117 | - | |
| 118 | - public function get_variants(): Component_Variants { | |
| 119 | - $meta = $this->get_json_meta( self::VARIANTS_META_KEY ); | |
| 120 | - | |
| 121 | - return Component_Variants::make( $meta ?? [] ); | |
| 122 | - } | |
| 123 | - | |
| 124 | - public function update_variants( $data ): Parse_Result { | |
| 125 | - $parser = Component_Variants_Parser::make(); | |
| 126 | - | |
| 127 | - $result = $parser->parse( $data ); | |
| 128 | - | |
| 129 | - if ( ! $result->is_valid() ) { | |
| 130 | - return $result; | |
| 131 | - } | |
| 132 | - | |
| 133 | - $sanitized_data = $result->unwrap(); | |
| 134 | - | |
| 135 | - $this->update_json_meta( self::VARIANTS_META_KEY, $sanitized_data ); | |
| 136 | 110 | |
| 137 | 111 | return $result; |
| 138 | 112 | } |
| 139 | 113 | |