Jake Vanderwerf
2026-04-26 5fe601cd1962dca79c0765a54ce864af5abb7d40
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
// /taxonomies/progress.php
use JVBase\registrar\Registrar;
 
if (!defined('ABSPATH')) {
    exit;
}
 
 
add_action('plugins_loaded', 'ajv_progress',1);
//Add fields later so we can verify taxonomies/post types exist
add_action('plugins_loaded', 'ajv_progress_fields', 2);
 
add_filter('ajv_ProgressSchemaDefault', 'ajv_progress_schema');
add_filter('ajv_ProgressMetaDefault', 'ajv_progress_meta');
add_filter('ajv_ProgressArchiveDefault', 'ajv_progress_archive');
 
function ajv_progress(){
    if (!class_exists('JVBase\registrar\Registrar')) {
        return;
    }
    $progress = Registrar::forTerm('progress', 'Progress', 'Progresss')
        ->setIcon('scribble')
        ->make([
            'rewrite'   => [
                'slug'          => 'in/progress',
                'with_front'    => false,
            ],
            'for'    => [
                'art',
                'design',
                'development',
                'strategy',
                'writing'
            ],
            'hierarchical'  => true,
        ])
        ->setAll([
            'show_feed',
            'show_directory',
        ]);
}
 
function ajv_progress_fields():void
{
    if (!class_exists('JVBase\registrar\Registrar')) {
        return;
    }
    $progress = Registrar::getInstance('progress');
 
    //$directory = $progress->getConfig('directory');
    //$breadcrumbs = $progress->config('breadcrumbs');
    //$breadcrumbs->setCrumb('project');
 
    $fields = $progress->fields();
    $fields->addCommon('wiki');
}
 
//function ajv_progress():array
//{
//    return [
//        'singular'       => 'Progress',
//        'plural'         => 'Progress',
//        'icon'           => 'circle-notch',
//        'show_feed'      => true,
//        'show_directory' => true,
//        'approve_new'    => false,
//        'rewrite'        => [
//            'slug'         => 'progress',
//            'with_front'   => false,
//            'hierarchical' => true,
//        ],
//        'hierarchical'   => true,
//        'for_content'    => [
//            'art',
//            'progress',
//            'development',
//            'strategy',
//            'writing',
//        ],
//        'seo' => [
//            'meta' => [
//                'title' => '{{name}} Projects | JakeVan',
//            ],
//            'archive' => [
//                'type' => 'CollectionPage',
//                'name' => '{{name}} Projects',
//            ],
//        ],
//        'fields'         => [
//            'term_name' => [
//                'label'     => 'Name',
//                'type'      => 'text',
//                'quickEdit' => true,
//            ],
//            'common'    => [ 'wiki' ]
//        ]
//    ];
//}
 
 
function ajv_progress_schema():array
{
    return [
        'type'              => 'JVBase\managers\SEO\render\Thing\CreativeWork\CreativeWork',
        'name'              => '{{name}} Projects',
        'description'       => '{{description}}',
    ];
}
 
function ajv_progress_meta():array
{
    return[
        'name' => '{{name}} Projects',
    ];
}
 
function ajv_progress_archive(array $defaults):array
{
    return array_merge($defaults, [
        'name' => '{{name}} Projects',
    ]);
}
 
function ajv_progress_reference_schema(array $defaults):array
{
    return $defaults;
}