Jake Vanderwerf
2026-01-01 0a0bd7b0e9e09bdefba6c336d6373135139eea9f
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<?php
if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly
}
function jvbAlphabetizeMe(
    array $list,
    string $name='',
    string $url = '',
    string $ID='',
    $extra = false
):array {
    if ($name == '') {
        $name = get_the_title();
    }
    if ($url == '') {
        $url = get_the_permalink();
    }
    if ($ID == '') {
        $ID = get_the_ID();
    }
 
    $first = strtolower(mb_substr($name, 0, 1));
    $list[$first][] = array(
        'name'  => $name,
        'url'   => $url,
        'id'    => $ID,
        'extra' => $extra,
    );
    return $list;
}
 
function jvbGetListTypes():array
{
    $return = get_option(BASE.'list_types', false);
    if (!$return) {
        $directories = jvbGlobalDirectories();
        $directories = array_merge($directories['content'],$directories['taxonomy']);
        foreach ($directories as $key => $directory) {
            $ID = jvbGetPageId($directory['page']);
 
            $directories[$key]['ID'] = $ID;
            $directories[$key]['url'] = get_the_permalink($ID);
        }
        $return = $directories;
        $mapID = jvbGetPageId('Map');
        $url = get_the_permalink($mapID);
        $return[] = [
            'slug'  => 'map',
            'title'    => 'Map',
            'ID'    => $mapID,
            'url'    => $url,
            'page'    => 'Map',
            'type'    => 'term',
        ];
        update_option(BASE.'list_types', $return);
    }
    return $return;
}
 
function jvbDirectoryFrom(string|int|null $from, mixed $search):array
{
    $directories = jvbGlobalDirectoryInfo();
    $col = array_column($directories, $from);
    return $directories[array_search($search, $col)];
}
 
function jvbGetDirectoryIntro(string $type):string
{
    switch ($type) {
        case BASE.'artist':
            $intro = [
                'From old-school legends to fresh talent, here\'s your backstage pass to Edmonton\'s tattoo scene.',
                'Every artist, every style. No algorithm. No BS. Just pure Edmonton ink.'
            ];
            break;
 
        case BASE.'shop':
            $map = jvbGetPageId('Map');
            $intro = [
                'The beating hearts of Edmonton\'s tattoo scene. Street by street, neighborhood by neighborhood.',
                'Your map to Edmonton\'s best tattoo shops. Real spaces. Real artists. Real ink.',
                'Want the actual map? <a href="'.get_home_url().'/directory/map/" data-type="page" data-id="'.$map.'">Check it here</a>.'
            ];
            break;
 
        case BASE.'style':
            $intro = [
                'From traditional roots to bleeding-edge techniques.',
                'This is your visual dictionary to tattoo styles in Edmonton. Because great tattoos start with knowing what you want.'
            ];
            break;
 
        case BASE.'theme':
            $intro = [
                'Stories told in ink. Symbols that speak. Imagery that inspires.',
                'Explore what\'s possible when Edmonton artists tackle your ideas. Different styles, same subject. Pure creative freedom.'
            ];
            break;
 
        case BASE.'piercing':
            $intro = [
                'Beyond ink: piercings, spacers, and more. The next level of body art in Edmonton.',
                'Your guide to professional body mod artists. Because your body is a canvas, and ink is just the beginning.'
            ];
            break;
 
        case BASE.'artstyle':
            $intro = [
                'When tattoo artists break free from skin. Their personal styles, unleashed on canvas, walls, and beyond.',
                'Where street meets gallery. Pure Edmonton creativity, no boundaries.'
            ];
            break;
 
        case BASE.'arttheme':
            $intro = [
                'The subjects that drive Edmonton artists. From urban landscapes to surreal visions.',
                'See how themes transform across mediums. Same story, different canvas.'
            ];
            break;
 
        case BASE.'arttype':
            $intro = [
                'Sculpture to canvas, digital to print. Your tattoo artist\'s other obsessions.',
                'Discover the full range of Edmonton\'s artistic underground. Every medium, every surface.'
            ];
            break;
 
        case BASE.'artmedium':
            $intro = [
                'Tools of the trade beyond the machine. Paint, pixels, pencils, and everything between.',
                'Browse art by medium. Because great artists never stop experimenting.'
            ];
            break;
 
        case BASE.'partner':
            $intro = [
                'The brands and businesses that get it. Vetted by artists, trusted by the community.',
                'Supporting Edmonton\'s tattoo scene. No sellouts, just solid connections.'
            ];
            break;
 
        case BASE.'event':
            $intro = [
                'Flash days, guest spots, and exclusive drops from Edmonton\'s tattoo community.',
                'Direct from the artists to you. No middleman, no markup, just pure opportunity.'
            ];
            break;
        case BASE.'offer':
            $intro = [
                'Exclusive deals from the brands that support Edmonton\'s tattoo scene. Supplies, gear, merch, and more.',
                'Community vetted, artist approved. Direct from our partners to your stash.'
            ];
            break;
 
        default:
            $intro = [];
            break;
    }
 
    if (empty($intro)) {
        return '';
    }
 
    return implode('', array_map(function ($paragraph) {
        return "<!-- wp:paragraph --><p>{$paragraph}</p><!-- /wp:paragraph -->";
    }, $intro));
}
 
function jvbGetPageId(string $title):int
{
    $page = new WP_Query(
        [
            'post_type' => 'page',
            'title' => $title,
            'posts_per_page'    => 1,
            'fields'    => 'ids',
        ]
    );
    wp_reset_postdata();
    $result = ($page->have_posts()) ? $page->posts[0] : false;
    if (!$result) {
        $result = wp_insert_post([
            'post_title'    => $title,
            'post_type'     => 'page',
            'post_status'   => 'publish',
        ]);
    }
    return $result;
}
 
 
function jvbLetters():array
{
    return array(
        'a',
        'b',
        'c',
        'd',
        'e',
        'f',
        'g',
        'h',
        'i',
        'j',
        'k',
        'l',
        'm',
        'n',
        'o',
        'p',
        'q',
        'r',
        's',
        't',
        'u',
        'v',
        'w',
        'x',
        'y',
        'z'
    );
}