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

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + namespace Blocksy\DbVersioning;
4 +
5 + class V2034 {
6 + public function migrate() {
7 + if (! function_exists('wc_get_attribute_taxonomies')) {
8 + return;
9 + }
10 +
11 + foreach (array_values(wc_get_attribute_taxonomies()) as $tax) {
12 + $taxonomy = (array) $tax;
13 +
14 + $meta = blocksy_get_taxonomy_options($taxonomy['attribute_id']);
15 +
16 + if (
17 + $meta
18 + &&
19 + isset($meta['swatch_type'])
20 + &&
21 + $taxonomy['attribute_type'] !== $meta['swatch_type']
22 + ) {
23 + wc_update_attribute(
24 + $taxonomy['attribute_id'],
25 + [
26 + 'name' => $taxonomy['attribute_label'],
27 + 'slug' => $taxonomy['attribute_name'],
28 + 'type' => $meta['swatch_type'],
29 + 'order_by' => $taxonomy['attribute_orderby'],
30 + 'has_archives' => $taxonomy['attribute_public']
31 + ]
32 + );
33 + }
34 + }
35 + }
36 + }
37 +
38 +