Jake Vanderwerf
2026-08-29 f859e64a57c624ff2daa2b21355f65a49fd4807d
inc/meta/Meta.php
@@ -149,7 +149,7 @@
            'type'   => 'text',
            'label'  => 'Short Description',
         ];
         $fields['post_id'] = [
         $fields['ID'] = [
            'type'   => 'text',
            'label'  => 'ID',
         ];
@@ -178,6 +178,7 @@
         $product = wc_get_product($id);
         $fields['sku'] = [
            'type'   => 'text',
            'label'  => 'SKU',
@@ -257,6 +258,23 @@
         $value = '';
         if ($this->type === 'option') {
            $value = get_option(BASE . $fieldName, $config['default'] ?? '');
         } else if ($this->wpObject && $this->wpObject->post_type === 'product') {
            if (property_exists($this->wpObject, $fieldName)) {
               $value = $this->wpObject->$fieldName;
            } else {
               $product = wc_get_product($this->wpObject->ID);
               $value = match ($fieldName) {
                  'sku' => $product->get_sku(),
                  '_price' => $product->get_price(),
                  'description'=> $product->get_short_description(),
                  'sale'   => $product->get_sale_price(),
                  'img' => $product->get_image_id(),
                  '_stock' => $product->get_stock_quantity(),
                  '_stock_status'   => $product->get_stock_status(),
                  default => '',
               };
            }
         } else if (
            ($this->wpObject && property_exists($this->wpObject, $fieldName))
            || ($type === 'user' && $this->wpObject && property_exists($this->wpObject->data, $fieldName))) {