From 32ce5c542c90be348895328078e392dde2052957 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 04 Sep 2026 19:15:16 +0000
Subject: [PATCH] =Working at adding defined fields to a dedicated panel in the gutenberg editor. Registrar now has AddCustomFields.php, which currently only supports post fields. Added a @wordpress/plugins base _meta/fields in /build and /src that successfully creates a panel. Next steps: determine sections and fields, group fields by section (each section to a panel), and save output

---
 inc/registrar/Registrar.php |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/inc/registrar/Registrar.php b/inc/registrar/Registrar.php
index d5aa2cd..7b6e7ab 100644
--- a/inc/registrar/Registrar.php
+++ b/inc/registrar/Registrar.php
@@ -3,6 +3,7 @@
 
 
 use JVBase\base\Site;
+use JVBase\inc\registrar\helpers\AddCustomFields;
 use JVBase\inc\registrar\helpers\HideSingle;
 use JVBase\managers\Cache;
 use JVBase\managers\CRUD;
@@ -57,6 +58,8 @@
 	public bool $baseless = false;
 	public bool $modify = false;
 
+	protected ?AddCustomFields $addFields = null;
+
 	protected static array $allFlags = [
 		//Shared Flags
 		'favouritable', 'karma', 'show_feed', 'show_directory', 'approve_new', 'has_responses', 'invitable',
@@ -437,12 +440,12 @@
 	{
 		$this->fields = new Fields($this->type, $this);
 	}
-	public function getFields():array
+	public function getFields(bool $includeDefaults = true):array
 	{
 		return array_map(function ($field) {
 			return $field->getConfig();
 		},
-			$this->fields->getFields()
+			$this->fields->getFields($includeDefaults)
 		);
 	}
 	public function setIcon(string $icon):self
@@ -885,6 +888,7 @@
 			if ($this->registrar) {
 				$this->registrar->register();
 			}
+			$this->addFields = new AddCustomFields($this);
 			if ($this->add_image_column) {
 				add_filter("manage_{$this->based}_posts_columns", [$this, 'addImageColumn']);
 				add_action("manage_{$this->based}_posts_custom_column", [$this, 'showImageColumn'], 10, 2);

--
Gitblit v1.10.0