From 3baf3d2545ba6ece6b74a64c0def59bd0774cf54 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 10 Jun 2026 16:34:12 +0000
Subject: [PATCH] =Laid the groundwork for an improved DashboardManager.php setup. Have to put it aside so I can get the dang Northeh done though.
---
inc/meta/Meta.php | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/inc/meta/Meta.php b/inc/meta/Meta.php
index 744fae5..d870467 100644
--- a/inc/meta/Meta.php
+++ b/inc/meta/Meta.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\meta;
+use JVBase\base\Options;
use JVBase\registrar\Registrar;
use WP_Post;
use WP_Term;
@@ -75,7 +76,7 @@
/**
* Create Meta instance for options
*/
- public static function forOptions(?string $baseKey = 'ajv'): self
+ public static function forOptions(?string $baseKey = BASE): self
{
if (array_key_exists($baseKey, self::$instances['options'])) {
return self::$instances['options'][$baseKey];
@@ -118,6 +119,10 @@
$registrar = !is_null($this->slug) ? Registrar::getInstance($this->slug) : false;
$fields = $registrar ? $registrar->getFields() : [];
+ if ($this->type == 'options') {
+ $options = Options::getInstance();
+ $fields = $options->getFields();
+ }
$meta = match($type) {
'post' => get_post_meta($id),
'term' => get_term_meta($id),
@@ -197,6 +202,11 @@
}
if (!array_key_exists($name, $this->fields)) {
error_log('[Meta]::get Attempted to get unregistered field: '.$name);
+ return '';
+ }
+ if (is_null($this->fields[$name])) {
+ error_log('[Meta]::get Field does not seem to be setup yet: '.$name);
+ return '';
}
return $this->fields[$name]->get()??'';
}
--
Gitblit v1.10.0