STRATO-apps/wordpress_03/app/wp-content/themes/blocksy/inc/classes/db-versioning/v2-0-53.php
SHA-256: f60d4fcb83b0b7f01d9b7c9737e0cc4698d47f1bb3dbe9cbfb867eefc62c509b
<?php
namespace Blocksy\DbVersioning;
class V2053 {
public function migrate() {
$maybe_taxonomy = get_taxonomy('product_brands');
if (! $maybe_taxonomy) {
return;
}
$terms = get_terms([
'taxonomy' => 'product_brands'
]);
foreach ($terms as $term) {
$options = blocksy_get_taxonomy_options(
$term->term_id,
'product_brands'
);
if (! isset($options['image']) || empty($options['image'])) {
continue;
}
$options['icon_image'] = $options['image'];
$options['image'] = '';
update_term_meta(
$term->term_id,
'blocksy_taxonomy_meta_options',
$options
);
}
}
}