From 48721c85ebcfa973ee81719d2467ca80e4253dc9 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 01 May 2026 17:30:03 +0000
Subject: [PATCH] =Edmonton Ink hard test begins! Real testing of the managers and reset routes will commence. So far, just ensuring our classes are all loaded correctly: Site() and its sub-classes Membership, Login, etc. Care should be taken to load conditionally on 'init', as we finish defining most settings by 'plugins_loaded' at priority 5
---
inc/blocks/_setup.php | 112 ++++++++++++++++++++++++++++----------------------------
1 files changed, 56 insertions(+), 56 deletions(-)
diff --git a/inc/blocks/_setup.php b/inc/blocks/_setup.php
index c5b6d1d..43ff5c5 100644
--- a/inc/blocks/_setup.php
+++ b/inc/blocks/_setup.php
@@ -6,30 +6,64 @@
//require(JVB_DIR . '/inc/blocks/RegisterBlocks.php');
require(JVB_DIR . '/inc/blocks/CustomBlocks.php');
-if (Site::has('feed_block')) {
- require(JVB_DIR . '/inc/blocks/FeedBlock.php');
- new JVBase\blocks\FeedBlock();
+
+add_action('init', 'jvb_conditionally_load_blocks', 1);
+function jvb_conditionally_load_blocks(): void
+{
+ if (Site::has('feed_block')) {
+ require(JVB_DIR . '/inc/blocks/FeedBlock.php');
+ new JVBase\blocks\FeedBlock();
+ }
+
+ if (Site::has('is_restaurant')) {
+ require(JVB_DIR . '/inc/blocks/MenuBlock.php');
+ new JVBase\blocks\MenuBlock();
+ }
+
+ if (Site::has('faq')) {
+ require(JVB_DIR . '/inc/blocks/FAQBlock.php');
+ new JVBase\blocks\FAQBlock();
+ }
+
+ if (!empty(Registrar::getFeatured('is_glossary'))) {
+ require(JVB_DIR . '/inc/blocks/GlossaryBlock.php');
+ new JVBase\blocks\GlossaryBlock();
+ }
+
+ if (!empty(Registrar::getFeatured('is_timeline'))) {
+ require(JVB_DIR . '/inc/blocks/TimelineBlock.php');
+ new JVBase\blocks\TimelineBlock();
+ }
+
+ if (Site::hasIntegration('gmb')) {
+ require(JVB_DIR . '/build/gmbreviews/render.php');
+ register_block_type(
+ JVB_DIR . '/build/gmbreviews',
+ [
+ 'render_callback' => 'jvbRenderGMBReviewsBlock'
+ ]);
+ }
+// if (jvbSiteUsesFeedBlock()) {
+// register_block_type(
+// JVB_DIR . '/build/feed',
+// [
+// 'render_callback' => 'jvbRenderFeedBlock'
+// ]
+// );
+// }
+ if (!empty(Registrar::getFeatured('show_directory'))) {
+ register_block_type(
+ JVB_DIR . '/build/list',
+ [
+ 'render_callback' => 'jvbRenderListBlock'
+ ]
+ );
+ }
+ register_block_type(
+ JVB_DIR . '/build/drawer-menu',
+ );
}
-if (Site::has('is_restaurant')) {
- require(JVB_DIR . '/inc/blocks/MenuBlock.php');
- new JVBase\blocks\MenuBlock();
-}
-
-if (Site::has('faq')) {
- require(JVB_DIR . '/inc/blocks/FAQBlock.php');
- new JVBase\blocks\FAQBlock();
-}
-
-if (!empty(Registrar::getFeatured('is_glossary'))) {
- require(JVB_DIR . '/inc/blocks/GlossaryBlock.php');
- new JVBase\blocks\GlossaryBlock();
-}
-
-if (!empty(Registrar::getFeatured('is_timeline'))) {
- require(JVB_DIR . '/inc/blocks/TimelineBlock.php');
- new JVBase\blocks\TimelineBlock();
-}
require(JVB_DIR . '/inc/blocks/SummaryBlock.php');
new JVBase\blocks\SummaryBlock();
@@ -52,37 +86,3 @@
]);
}
add_filter('block_categories_all', 'jvbRegisterBlockCategory');
-
-if (Site::hasIntegration('gmb')) {
- require(JVB_DIR . '/build/gmbreviews/render.php');
-}
-function jvbRegisterBlocks():void
-{
- if (Site::hasIntegration('gmb')) {
- register_block_type(
- JVB_DIR . '/build/gmbreviews',
- [
- 'render_callback' => 'jvbRenderGMBReviewsBlock'
- ]);
- }
-// if (jvbSiteUsesFeedBlock()) {
-// register_block_type(
-// JVB_DIR . '/build/feed',
-// [
-// 'render_callback' => 'jvbRenderFeedBlock'
-// ]
-// );
-// }
- if (!empty(Registrar::getFeatured('show_directory'))) {
- register_block_type(
- JVB_DIR . '/build/list',
- [
- 'render_callback' => 'jvbRenderListBlock'
- ]
- );
- }
- register_block_type(
- JVB_DIR . '/build/drawer-menu',
- );
-}
-add_action('init', 'jvbRegisterBlocks');
--
Gitblit v1.10.0