Jake Vanderwerf
2026-08-28 a9654f00c8fbc9934289d761843ddd071025013f
inc/meta/Storage.php
@@ -4,6 +4,7 @@
use Exception;
use JVBase\managers\Cache;
use JVBase\managers\Errors;
use wpdb;
if (!defined('ABSPATH')) {
   exit;
@@ -14,7 +15,7 @@
 */
class Storage
{
   protected \wpdb $wpdb;
   protected wpdb $wpdb;
   public function __construct()
   {
@@ -174,7 +175,7 @@
            'item_id' => $item->id,
            'object_type' => $item->objectType,
            'fields' => array_keys($dirty)
         ], 'error');
         ]);
         return false;
      }
   }
@@ -188,7 +189,7 @@
      $config = $item->getFieldConfig($name);
      if ($config && ($config['type'] ?? '') === 'taxonomy' && !isset($config['taxonomy_type'])) {
         $taxonomy = jvbCheckBase($config['taxonomy']);
         wp_set_object_terms($item->id, [], $taxonomy, false);
         wp_set_object_terms($item->id, [], $taxonomy);
         return true;
      }
@@ -326,7 +327,7 @@
            $results[$meta->item()->id ?? 'options'] = false;
         }
         Errors::getInstance()->log('meta_storage', 'Bulk save failed: ' . $e->getMessage(), [], 'error');
         Errors::getInstance()->log('meta_storage', 'Bulk save failed: ' . $e->getMessage());
         return $results;
      }
@@ -541,12 +542,12 @@
      $taxonomy = jvbCheckBase($field->config['taxonomy']);
      $value = $field->value;
      if (empty(trim((string)$value))) {
         wp_set_object_terms($item->id, [], $taxonomy, false);
         wp_set_object_terms($item->id, [], $taxonomy);
         return true;
      }
      $termIds = array_map('intval', array_filter(explode(',', $value)));
      $result = wp_set_object_terms($item->id, $termIds, $taxonomy, false);
      $result = wp_set_object_terms($item->id, $termIds, $taxonomy);
      return !is_wp_error($result);
   }
@@ -733,7 +734,7 @@
            ? []
            : array_map('intval', array_filter(explode(',', $update['value'])));
         wp_set_object_terms($update['object_id'], $termIds, $update['taxonomy'], false);
         wp_set_object_terms($update['object_id'], $termIds, $update['taxonomy']);
      }
   }