| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | use Elementor\Modules\Variables\ImportExportCustomization\Import_Export_Customization; |
| 10 | 10 | use Elementor\Modules\Variables\PropTypes\Color_Variable_Prop_Type; |
| 11 | 11 | use Elementor\Modules\Variables\PropTypes\Font_Variable_Prop_Type; |
| 12 | 12 | use Elementor\Modules\Variables\PropTypes\Size_Variable_Prop_Type; |
| 13 | +use Elementor\Modules\Variables\Storage\Constants; | |
| 13 | 14 | use Elementor\Plugin; |
| 14 | 15 | use Elementor\Utils; |
| 15 | 16 | |
| 16 | 17 | if ( ! defined( 'ABSPATH' ) ) { |
| @@ -55,8 +56,9 @@ | ||
| 55 | 56 | |
| 56 | 57 | ( new Import_Export_Customization() )->register_hooks(); |
| 57 | 58 | |
| 58 | 59 | add_action( 'init', [ $this, 'init_variable_types_registry' ] ); |
| 60 | + add_filter( 'elementor/kit/meta_to_preserve_on_kit_import', [ $this, 'add_meta_to_preserve_on_kit_import' ] ); | |
| 59 | 61 | add_action( 'elementor/editor/before_enqueue_scripts', fn () => $this->enqueue_editor_scripts() ); |
| 60 | 62 | } |
| 61 | 63 | |
| 62 | 64 | private function register_features() { |
| @@ -99,6 +101,12 @@ | ||
| 99 | 101 | 'elementor-common', |
| 100 | 102 | 'window.ElementorVariablesQuotaConfig = ' . wp_json_encode( $this->get_quota_config() ) . ';', |
| 101 | 103 | 'before' |
| 102 | 104 | ); |
| 105 | + } | |
| 106 | + | |
| 107 | + public function add_meta_to_preserve_on_kit_import( array $meta_keys ): array { | |
| 108 | + return array_merge( $meta_keys, [ | |
| 109 | + Constants::VARIABLES_META_KEY, | |
| 110 | + ] ); | |
| 103 | 111 | } |
| 104 | 112 | } |