From 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Aug 2026 22:57:22 +0000
Subject: [PATCH] =It's been a minute. I went through the Routes and associated Managers and ensured they played together well. Reworked the Cache.php, and I think I caught all the references. Moving away from JVBase() root class, to individuall classes that are Instanced. Double checked for the ABSPATH check in every file, and added index.php to every directory that didn't already have it. Also still working on the MenuBlock to work with WooCommerce for now for Northeh
---
inc/rest/routes/Invitations.php | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/inc/rest/routes/Invitations.php b/inc/rest/routes/Invitations.php
index 6322115..90f0385 100644
--- a/inc/rest/routes/Invitations.php
+++ b/inc/rest/routes/Invitations.php
@@ -1,6 +1,8 @@
<?php
namespace JVBase\rest\routes;
+use JVBase\Instance;
+use JVBase\managers\InvitationsManager;
use JVBase\rest\Rest;
use JVBase\managers\CustomTable;
use JVBase\rest\Route;
@@ -20,6 +22,7 @@
*/
class Invitations extends Rest
{
+ use Instance;
protected array $inviteConfig;
protected CustomTable $table;
@@ -29,7 +32,7 @@
parent::__construct();
// Get invitation configuration
- $this->inviteConfig = JVB()->invitations()->getInviteConfig();
+ $this->inviteConfig = InvitationsManager::getInstance()->getInviteConfig();
$this->table = CustomTable::for('invitations');
// Cache connections
@@ -107,7 +110,7 @@
protected function getTermInvitations(array $args): array
{
// Check permission
- if (!JVB()->roles()->isManager($args['user'], $args['to_term'])) {
+ if (!Roles::getInstance()()->isManager($args['user'], $args['to_term'])) {
return $this->forbidden('You cannot view invitations for this ' . $args['taxonomy'])->get_data();
}
@@ -213,7 +216,7 @@
}
// Queue using fluent interface
- $op = JVB()->queue()->add(
+ $op = Queue::getInstance()->add(
'invitation_create',
$userID,
['invitations' => $validated],
@@ -231,7 +234,7 @@
*/
protected function validateInvitations(int $userID, array $invites): array
{
- return JVB()->invitations()->validateInvitations($userID, $invites);
+ return InvitationsManager::getInstance()->validateInvitations($userID, $invites);
}
@@ -248,7 +251,7 @@
return $this->error('Invitation ID required');
}
- $op = JVB()->queue()->add(
+ $op = Queue::getInstance()->add(
'invitation_revoke',
$userID,
['invitation_id' => $invitationID],
@@ -269,7 +272,7 @@
return $this->error('Invitation ID required');
}
- $op = JVB()->queue()->add(
+ $op = Queue::getInstance()->add(
'invitation_resend',
$userID,
['invitation_id' => $invitationID],
@@ -308,7 +311,7 @@
];
// Add term information if present
- foreach (JVB()->roles()->getInvitableTaxonomies() as $taxonomy) {
+ foreach (Roles::getInstance()()->getInvitableTaxonomies() as $taxonomy) {
$column = 'to_' . $taxonomy;
if (isset($invitation->$column) && $invitation->$column) {
$termID = (int) $invitation->$column;
--
Gitblit v1.10.0