From 235ce5716edc2f7cbe80fdccf26eac7269587839 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 08 Jun 2026 04:38:18 +0000
Subject: [PATCH] =FavouritesManager.php and FavouritesRoutes.php fixes. Moving all logic to FavouritesManager.php. Still some left to do

---
 inc/blocks/CustomBlocks.php |   38 +++++++++++++++++++++++++++++---------
 1 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/inc/blocks/CustomBlocks.php b/inc/blocks/CustomBlocks.php
index 98c088f..9d77437 100644
--- a/inc/blocks/CustomBlocks.php
+++ b/inc/blocks/CustomBlocks.php
@@ -141,6 +141,11 @@
 				'jvb/summary',
 				'jvb/feed',
 				'jvb/forms',
+				'jvb/gmbreviews',
+				'jvb/timeline',
+				'jvb/video',
+				'jvb/faq',
+				'jvb/glossary'
 			];
 			if ($isPrerender) {
 				$base = array_merge($base, [
@@ -167,13 +172,20 @@
 
     public function render(string $content, array $block):string
     {
-		if ($block['blockName'] === 'jvb/feed') {
-			// Enqueue the feed block script (it will automatically load dependencies)
-			$this->localize_feedblock();
+		switch ($block['blockName']) {
+			case 'jvb/feed':
+				$this->localize_feedblock();
+				break;
+			case 'jvb/forms':
+				wp_enqueue_style('jvb-form');
+				break;
+			case 'jvb/timeline':
+				wp_enqueue_script('jvb-gallery');
+				add_action('wp_footer', 'jvbRenderGallery');
+				break;
 		}
-		if ($block['blockName'] === 'jvb/forms') {
-			wp_enqueue_style('jvb-form');
-		}
+
+
 
 		return $this->checkMethods($content, $block);
     }
@@ -758,7 +770,11 @@
 			'<table%s',
 			$this->getClassesAndStyles($attrs)
 		), $table);
-		$caption = str_replace(strtok($parts[1], '>'), '<figcaption', $parts[1]);
+		$caption = '';
+		if (array_key_exists(1, $parts)) {
+			$caption = str_replace(strtok($parts[1], '>'), '<figcaption', $parts[1]);
+		}
+
 
 		return sprintf(
 			'<figure%s>%s%s</figure>',
@@ -1402,6 +1418,7 @@
 				);
 			}
 		}
+
 		return sprintf(
 			'<ul%s>%s</ul>',
 			$this->getClassesAndStyles($block['attrs']??[], ['loop']),
@@ -1523,7 +1540,9 @@
 		protected function buildQueryArgs(array $attrs): array
 		{
 			$queryID = $attrs['queryId'] ?? null;
-			$args = [];
+			$args = [
+				'post_status'	=> 'publish',
+			];
 			foreach (($attrs['query'] ?? []) as $key => $value) {
 				if (empty($value)) continue;
 				switch ($key) {
@@ -2811,8 +2830,9 @@
 
 			$type = 'row';
 			$isRow = true;
+
 			//Determine type
-			if ((array_key_exists('type', $value) && !in_array($value['type'], ['flex', 'grid'])) ||
+			if ((array_key_exists('type', $value) && !in_array($value['type'], ['flex', 'grid', 'default'])) ||
 				(array_key_exists('orientation', $value) && $value['orientation'] === 'vertical')) {
 				$type = 'col';
 				$isRow = false;

--
Gitblit v1.10.0