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 | core/kits/manager.php +7 -27 4.1.0-dev13.27.4 View file →
@@ -6,9 +6,9 @@
6 6 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
7 7 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
8 8 use Elementor\Plugin;
9 9 use Elementor\Core\Files\CSS\Post as Post_CSS;
10 -use Elementor\Core\Files\CSS\Post_Preview;
10 +use Elementor\Core\Files\CSS\Post_Preview as Post_Preview;
11 11 use Elementor\Core\Documents_Manager;
12 12 use Elementor\Core\Kits\Documents\Kit;
13 13 use Elementor\TemplateLibrary\Source_Local;
14 14 use Elementor\Utils;
@@ -71,9 +71,9 @@
71 71 /**
72 72 * Returns an empty kit for situation when there is no kit in the site.
73 73 *
74 74 * @return Kit
75 - * @throws \Exception If the kit instance cannot be created.
75 + * @throws \Exception
76 76 */
77 77 private function get_empty_kit_instance() {
78 78 return new Kit( [
79 79 'settings' => [],
@@ -137,16 +137,12 @@
137 137
138 138 public function create_new_kit( $kit_name = '', $settings = [], $active = true ) {
139 139 $kit_name = $kit_name ? $kit_name : esc_html__( 'Custom', 'elementor' );
140 140
141 - $current_kit = $this->get_active_kit();
142 -
143 - $kit_meta_data = $this->get_meta_to_preserve( $current_kit );
144 -
145 141 $id = $this->create( [
146 142 'post_title' => $kit_name,
147 143 'settings' => $settings,
148 - ], $kit_meta_data );
144 + ] );
149 145
150 146 if ( $active ) {
151 147 update_option( self::OPTION_PREVIOUS, $this->get_active_id() );
152 148 update_option( self::OPTION_ACTIVE, $id );
@@ -154,24 +150,8 @@
154 150
155 151 return $id;
156 152 }
157 153
158 - private function get_meta_to_preserve( Kit $current_kit ): array {
159 - $meta_keys_to_preserve = apply_filters( 'elementor/kit/meta_to_preserve_on_kit_import', [] );
160 -
161 - $kit_meta_data = [];
162 -
163 - foreach ( $meta_keys_to_preserve as $meta_key ) {
164 - $value = $current_kit->get_meta( $meta_key );
165 -
166 - if ( ! empty( $value ) ) {
167 - $kit_meta_data[ $meta_key ] = $value;
168 - }
169 - }
170 -
171 - return $kit_meta_data;
172 - }
173 -
174 154 public function create_default() {
175 155 return $this->create( [
176 156 'post_title' => esc_html__( 'Default Kit', 'elementor' ),
177 157 ] );
@@ -319,9 +299,9 @@
319 299 * Map Scheme To Global
320 300 *
321 301 * Convert a given scheme value to its corresponding default global value
322 302 *
323 - * @param string $type 'color'/'typography'.
303 + * @param string $type 'color'/'typography'
324 304 * @param $value
325 305 * @return mixed
326 306 */
327 307 private function map_scheme_to_global( $type, $value ) {
@@ -354,9 +334,9 @@
354 334 * @access public
355 335 */
356 336 public function convert_scheme_to_global( $scheme ) {
357 337 if ( isset( $scheme['type'] ) && isset( $scheme['value'] ) ) {
358 - // _deprecated_argument( $args['scheme'], '3.0.0', 'Schemes are now deprecated - use $args[\'global\'] instead.' );
338 + //_deprecated_argument( $args['scheme'], '3.0.0', 'Schemes are now deprecated - use $args[\'global\'] instead.' );
359 339 return $this->map_scheme_to_global( $scheme['type'], $scheme['value'] );
360 340 }
361 341
362 342 // Typography control 'scheme' properties usually only include the string with the typography value ('1'-'4').
@@ -393,10 +373,10 @@
393 373
394 374 /**
395 375 * Send a confirm message before move a kit to trash, or if delete permanently not for trash.
396 376 *
397 - * @param $post_id
398 - * @param bool $is_permanently_delete
377 + * @param $post_id
378 + * @param false $is_permanently_delete
399 379 */
400 380 private function before_delete_kit( $post_id, $is_permanently_delete = false ) {
401 381 if ( $this->should_skip_trash_kit_confirmation ) {
402 382 return;