Jake Vanderwerf
2026-05-01 48721c85ebcfa973ee81719d2467ca80e4253dc9
inc/managers/IconsManager.php
@@ -2,7 +2,7 @@
namespace JVBase\managers;
use JVBase\registrar\Registrar;
use JVBase\utility\Features;
use JVBase\base\Site;
if (!defined('ABSPATH')) {
   exit;
@@ -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();
@@ -351,16 +349,16 @@
         $map = [
            'seo' => 'robot'
         ];
         if (Features::forSite()->has('referrals')) {
         if (Site::has('referrals')) {
            $map['referrals'] = 'hand-heart';
         }
         if (Features::forSite()->has('dashboard')) {
         if (Site::has('dashboard')) {
            $map['dash'] = 'door';
         }
         if (Features::forSite()->has('magicLink')) {
         if (Site::has('magicLink')) {
            $map['magicLink'] = 'magic-wand';
         }
         if (Features::hasAnyIntegration()) {
         if (Site::hasAnyIntegration()) {
            $map['integrations'] = 'plugs-connected';
         }
         update_option(BASE.'iconMap', $map);
@@ -521,7 +519,7 @@
    */
   public function get(string $name, array $options = []): string
   {
      if ($name === '') {
      if (empty($name)) {
         //No icon requested
         return '';
      }
@@ -699,6 +697,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}";