Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/classes/db-versioning/v2-1-1.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
3
+
namespace Blocksy\DbVersioning;
4
+
5
+
class V211 {
6
+
public function migrate() {
7
+
if (
8
+
! function_exists('wc_get_attribute_taxonomies')
9
+
||
10
+
! class_exists('\Blocksy\Plugin')
11
+
||
12
+
! in_array(
13
+
'woocommerce-extra',
14
+
get_option('blocksy_active_extensions', [])
15
+
)
16
+
) {
17
+
return;
18
+
}
19
+
20
+
if (! class_exists('\Blocksy\Extensions\WoocommerceExtra\Storage')) {
21
+
return;
22
+
}
23
+
24
+
$storage = new \Blocksy\Extensions\WoocommerceExtra\Storage();
25
+
$settings = $storage->get_settings();
26
+
27
+
if (
28
+
! isset($settings['features']['variation-swatches'])
29
+
||
30
+
! $settings['features']['variation-swatches']
31
+
) {
32
+
return;
33
+
}
34
+
35
+
if (! function_exists('blocksy_get_woo_archive_layout_defaults')) {
36
+
return;
37
+
}
38
+
39
+
$woo_card_layout = get_theme_mod(
40
+
'woo_card_layout',
41
+
blocksy_get_woo_archive_layout_defaults()
42
+
);
43
+
44
+
$touched = false;
45
+
46
+
foreach ($woo_card_layout as $index => $layer) {
47
+
if ($layer['id'] !== 'product_swatches') {
48
+
continue;
49
+
}
50
+
51
+
if (
52
+
! isset($layer['options']['limit_number_of_swatches'])
53
+
||
54
+
$layer['options']['limit_number_of_swatches'] === 'no'
55
+
) {
56
+
continue;
57
+
}
58
+
59
+
$limit = blocksy_akg('limit', $layer['options'], 10);
60
+
61
+
set_theme_mod('limit_number_of_swatches', 'yes');
62
+
set_theme_mod('archive_limit_number_of_swatches_number', $limit);
63
+
}
64
+
}
65
+
}
66
+
67
+
68
+