Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/classes/db-versioning/v2-0-19.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
3
+
namespace Blocksy\DbVersioning;
4
+
5
+
class V2019 {
6
+
public function migrate() {
7
+
$this->migrate_menu_indicator_color('header_placements');
8
+
$this->migrate_menu_indicator_color('footer_placements');
9
+
}
10
+
11
+
public function migrate_menu_indicator_color($panel_type) {
12
+
$placements = get_theme_mod($panel_type, []);
13
+
14
+
if (empty($placements)) {
15
+
return;
16
+
}
17
+
18
+
$made_changes = false;
19
+
20
+
foreach ($placements['sections'] as $section_index => $single_section) {
21
+
foreach ($single_section['items'] as $item_index => $single_item) {
22
+
if (strpos($single_item['id'], 'menu') === false) {
23
+
continue;
24
+
}
25
+
26
+
if (
27
+
isset($single_item['values']['menuIndicatorColor'])
28
+
&&
29
+
isset($single_item['values']['menuIndicatorColor']['active'])
30
+
&&
31
+
! isset($single_item['values']['menuIndicatorColor']['hover'])
32
+
) {
33
+
$placements['sections'][$section_index][
34
+
'items'
35
+
][$item_index]['values'][
36
+
'menuIndicatorColor'
37
+
]['hover'] = $single_item['values'][
38
+
'menuIndicatorColor'
39
+
]['active'];
40
+
41
+
$made_changes = true;
42
+
}
43
+
}
44
+
}
45
+
46
+
if ($made_changes) {
47
+
set_theme_mod($panel_type, $placements);
48
+
}
49
+
}
50
+
}
51
+
52
+