From 894ec8a6f2ac62edbac7b3b6a88e3666f335c673 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 15 May 2026 15:08:42 +0000
Subject: [PATCH] =Refactor of CustomBlocks.php to move a majority of the logic to the pre_render_field instead of render_field, and adding support for more blocks
---
inc/managers/DashboardManager.php | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/inc/managers/DashboardManager.php b/inc/managers/DashboardManager.php
index 062c1bf..eea1901 100644
--- a/inc/managers/DashboardManager.php
+++ b/inc/managers/DashboardManager.php
@@ -27,7 +27,7 @@
{
$this->cache = Cache::for('dashboard', WEEK_IN_SECONDS)->connect('user');
add_action('init', [$this, 'registerDashboard']);
- $this->cache->flush();
+
$this->user = wp_get_current_user();
$this->role = jvbUserRole($this->user->ID);
$this->userLink = (int)get_user_meta($this->user->ID, BASE.'profile_link', true);
@@ -677,7 +677,10 @@
if (function_exists($function)) {
echo $function([],'');
} else {
- echo JVB()->blocks()->render_core_site_logo([],'');
+ echo render_block( [
+ 'blockName' => 'core/site-logo',
+ 'attrs' => [],
+ ]);
}
?>
@@ -754,8 +757,11 @@
$itemMenu = $item->submenu($slug);
foreach ($taxonomies as $s) {
$taxRegistrar = Registrar::getInstance($s);
- $itemMenu->addItem($taxRegistrar->getPlural(), $taxRegistrar->getIcon())
+ if ($taxRegistrar) {
+ $itemMenu->addItem($taxRegistrar->getPlural(), $taxRegistrar->getIcon())
->url($this->baseURL.'/'.$s);
+ }
+
}
}
}
--
Gitblit v1.10.0