Diff: STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/classes/db-versioning/v2-0-94.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + namespace Blocksy\DbVersioning;
4 +
5 + class V2094 {
6 + public function migrate() {
7 + $this->migrate_comments_label_position();
8 + $this->migrate_archive_thumbnail_size();
9 + }
10 +
11 + public function migrate_archive_thumbnail_size() {
12 + $option_id = 'woocommerce_archive_thumbnail_cropping';
13 +
14 + $value = get_option($option_id, '__empty__');
15 +
16 + if ($value === 'predefined') {
17 + update_option($option_id, 'custom');
18 + }
19 + }
20 +
21 + public function migrate_comments_label_position() {
22 + $is_fresh_setup = blocksy_manager()->db_versioning->is_fresh_setup();
23 +
24 + if ($is_fresh_setup) {
25 + return;
26 + }
27 +
28 + $prefixes = blocksy_manager()->screen->get_single_prefixes();
29 +
30 + foreach ($prefixes as $prefix) {
31 + $option_id = $prefix . '_comments_label_position';
32 +
33 + $value = get_theme_mod($option_id, '__empty__');
34 +
35 + if ($value !== '__empty__') {
36 + continue;
37 + }
38 +
39 + // For existing setups that didn't touch this option, return to
40 + // the previous default value of "inside".
41 + set_theme_mod($option_id, 'inside');
42 + }
43 + }
44 + }
45 +
46 +