From b0194e10a87e16797a568d8a30d53ebecd27d8a4 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 18 Oct 2025 15:04:51 +0000
Subject: [PATCH] =DataStore.js and UploaderManager.js overhaul
---
JVBase.php | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/JVBase.php b/JVBase.php
index 9f4519c..7191fff 100644
--- a/JVBase.php
+++ b/JVBase.php
@@ -25,6 +25,7 @@
use JVBase\rest\routes\FormRoutes;
use JVBase\rest\routes\NewsRoutes;
use JVBase\rest\routes\ReferralRoutes;
+use JVBase\rest\routes\MagicLinkRoutes;
use JVBase\rest\routes\ResponseRoutes;
use JVBase\rest\routes\OptionsRoutes;
use JVBase\rest\routes\VoteRoutes;
@@ -83,6 +84,11 @@
'userTerms' => new UserTermsManager(),
];
+ add_action('wp_footer', [$this, 'additionalActions']);
+
+ if (Features::forSite()->has('magicLink')) {
+ $this->routes['magicLink'] = new MagicLinkRoutes();
+ }
if (Features::forSite()->has('referrals')) {
$this->managers['referral'] = new ReferralManager();
$this->routes['referral'] = new ReferralRoutes();
@@ -262,4 +268,33 @@
return $this->managers['referral'];
}
+ public function additionalActions():void
+ {
+ $extras = apply_filters('jvbAdditionalActions', []);
+ $extras = array_filter($extras, function ($extra) {
+ return is_array($extra) && array_key_exists('button', $extra) && array_key_exists('content', $extra);
+ });
+ if (empty ($extras)) {
+ return;
+ }
+ $buttons = array_map(function ($extra) {
+ return $extra['button'];
+ }, $extras);
+ $contents = array_map(function($extra) {
+ return $extra['content'];
+ }, $extras);
+
+ if (!empty ($buttons)) {
+ ?>
+ <section class="additional-actions">
+ <div class="buttons col">
+ <?= implode($buttons); ?>
+ </div>
+ <div class="actions">
+ <?= implode($contents); ?>
+ </div>
+ </section>
+ <?php
+ }
+ }
}
--
Gitblit v1.10.0