From 1aa7c404dae63c9518468fe9b579fad819f8d871 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 13 Sep 2026 18:32:43 +0000
Subject: [PATCH] =Single Event page setup done through the new Event block. Currently working on the Simple Calendar block setup
---
inc/registrar/helpers/AddCustomFields.php | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/inc/registrar/helpers/AddCustomFields.php b/inc/registrar/helpers/AddCustomFields.php
index 87be897..2be7fd2 100644
--- a/inc/registrar/helpers/AddCustomFields.php
+++ b/inc/registrar/helpers/AddCustomFields.php
@@ -23,7 +23,7 @@
{
switch ($this->registrar->getType()) {
case 'post':
- add_action('save_post', [$this, 'checkPostFields']);
+ add_action('save_post', [$this, 'checkPostFields'], 10, 2);
add_action('enqueue_block_editor_assets', [$this, 'enqueue']);
break;
case 'term':
@@ -92,11 +92,13 @@
? $this->determineSchema($config)
: true;
- $schema = is_array($rawSchema) ? $this->schema($rawSchema) : $rawSchema;
//Allow for null
if ($metaType === 'object') {
- $metaType = ['object', 'null'];
+ $rawSchema['type'] = ['object', 'null'];
}
+
+ $schema = is_array($rawSchema) ? $this->schema($rawSchema) : $rawSchema;
+
register_post_meta($this->registrar->getBased(), jvbCheckBase($name), [
'single' => true,
'type' => $metaType,
@@ -104,7 +106,6 @@
'sanitize_callback' => fn($value) => (Sanitizer::sanitize($value, $config)),
'auth_callback' => fn($allowed, $key, $postID) => current_user_can('edit_post', $postID),
'show_in_rest' => $schema,
- 'revisions_enabled' => true,
]);
}
}
--
Gitblit v1.10.0