From 27fb820ae9081fb56957cf75e79eccd8a99edd52 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 14 Feb 2026 19:14:48 +0000
Subject: [PATCH] =minor css changes, queue merge logic restructured, and double checking changes actually changed in cRUD.js before sending to server
---
inc/rest/Route.php | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/inc/rest/Route.php b/inc/rest/Route.php
index 4deb44a..dd356a9 100644
--- a/inc/rest/Route.php
+++ b/inc/rest/Route.php
@@ -334,9 +334,33 @@
'email' => 'sanitize_email',
'url' => 'esc_url_raw',
'boolean', 'bool' => 'rest_sanitize_boolean',
+ 'array' => function($value) {
+ if (is_array($value)) {
+ return $value;
+ }
+ return [];
+ },
+ 'object' => function($value) {
+ if (is_array($value) || is_object($value)) {
+ return (array) $value;
+ }
+ return [];
+ },
default => null,
};
+ // Add validate callback for array/object types
+ if (in_array($type, ['array', 'object'])) {
+ $arg['validate_callback'] = function($value, $request, $param) {
+ // Allow empty arrays/objects
+ if (empty($value)) {
+ return true;
+ }
+ // Ensure it's an array or object
+ return is_array($value) || is_object($value);
+ };
+ }
+
// Parse modifiers
foreach (array_slice($parts, 1) as $part) {
$part = trim($part);
--
Gitblit v1.10.0