From 46d681c6b825d21b3f698d793c4e630c687d90ad Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 21 May 2026 21:41:53 +0000
Subject: [PATCH] =Major CustomBlocks.php overhaul, expanding block support and customization from the editor. theme.json should now be updated on new themes to set brand colours, etc. Also note: major change to .col vs .row alignment: simplifying it to .top .bottom vs the confusion of the differences for .col/.row .start and .a-start

---
 inc/managers/IconsManager.php |   29 +++++++++++++++++++++++------
 1 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/inc/managers/IconsManager.php b/inc/managers/IconsManager.php
index ee98705..f54120b 100644
--- a/inc/managers/IconsManager.php
+++ b/inc/managers/IconsManager.php
@@ -44,9 +44,7 @@
 	{
 		$this->source = $source;
 		$this->cache = Cache::for('icons_' . $source, WEEK_IN_SECONDS);
-		$this->style = (array_key_exists('icons', JVB_SITE) && in_array(JVB_SITE['icons'], $this->styles))
-			? JVB_SITE['icons']
-			: 'regular';
+		$this->style = Site::icon();
 
 		$this->addMap();
 
@@ -146,6 +144,7 @@
 				'apple-logo',
 				'check-circle',
 				'close-circle',
+				'faders-horizontal',
 				'cloud-slash',
 				'exclamation-mark',
 				'cloud-arrow-down',
@@ -196,6 +195,7 @@
 //			]
 		];
 
+
 		// Add icons from content/taxonomy/user configs (like old behavior)
 		$configIcons = $this->getIconsFromConfigs();
 		if (!empty($configIcons)) {
@@ -210,7 +210,6 @@
 		if (isset($allIcons[$this->source])) {
 			$icons = array_merge($icons, $allIcons[$this->source]);
 		}
-
 		if (!empty($icons)) {
 			$this->include($icons);
 		}
@@ -375,6 +374,7 @@
 	protected function registerGlobalHooks(): void
 	{
 		add_action('wp_loaded', [self::class, 'checkCSS']);
+		add_action('shutdown', [self::class, 'checkCSS']);
 	}
 
 	/**
@@ -521,7 +521,7 @@
 	 */
 	public function get(string $name, array $options = []): string
 	{
-		if ($name === '') {
+		if (empty($name)) {
 			//No icon requested
 			return '';
 		}
@@ -625,7 +625,7 @@
 	/**
 	 * Get raw SVG content for CSS mask-image
 	 */
-	protected function getRawSvg(string $name, ?string $style = null): ?string
+	public function getRawSvg(string $name, ?string $style = null): ?string
 	{
 		if (!$style) {
 			$style = $this->style;
@@ -672,6 +672,15 @@
 			foreach ($names as $icon) {
 				$svg = $this->getEncodedSVG($icon, $style);
 				if ($svg !== '') {
+					if ($icon === 'caret-down') {
+						$css .= 'details summary::after,';
+					} elseif ($icon === 'faders-horizontal') {
+						$css .= 'details.all-filters summary::after,';
+					} elseif ($icon === 'link') {
+						$css .= 'input[type=url],';
+					} elseif ($icon === apply_filters('jvbSeparatorLogo', 'logo')) {
+						$css .= 'hr.logo::before,';
+					}
 					$css .= ".icon-{$icon}{$styleClass}{";
 					$css .= "--icon:url('data:image/svg+xml;base64,{$svg}');";
 					$css .= "}";
@@ -699,6 +708,14 @@
 		if (!$style) {
 			$style = $this->style;
 		}
+
+		$icon = $this->map[$icon] ?? $icon;
+
+		// Validate icon exists
+		if (!$this->iconExists($icon, $style)) {
+			error_log('[IconsManager] Icon not found: ' . $icon);
+			return '';
+		}
 		$svg = $this->getEncodedSVG($icon, $style);
 		if ($svg !== '') {
 			return "data:image/svg+xml;base64,{$svg}";

--
Gitblit v1.10.0