Jake Vanderwerf
2026-08-30 f8ffc3dc1748b9af63123eb281696c0c30448715
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace JVBase;
 
use JVBase\blocks\CustomBlocks;
use JVBase\registrar\Registrar;
 
if (!defined('ABSPATH')) {
    exit;
}
 
class JVB
{
    protected static JVB|null $instance = null;
    protected array $managers = [];
    protected array $content = [];
    protected array $taxonomies = [];
    protected array $blocks = [];
    protected array $routes = [];
    protected CustomBlocks $customBlocks;
 
 
 
    public static function getInstance(): JVB
    {
        if (self::$instance === null) {
            self::$instance = new self();
        }
        return self::$instance;
    }
 
 
    private function __construct()
    {
    }
 
    public function routes($route): mixed
    {
        if (array_key_exists($route, $this->routes)) {
            return $this->routes[$route];
        }
        return false;
    }
 
 
    public function getFields($type): array
    {
        return Registrar::getFieldsFor($type)??[];
    }
 
    /**
     * @deprecated Should use the Registrar::getInstance
     * @param $type
     * @return mixed
     */
    public function getContent($type): mixed
    {
        return $this->content[$type] ?? $this->taxonomies[$type] ?? $this->blocks[$type] ?? null;
    }
 
}