Jake Vanderwerf
2026-05-01 11f29668ba55c9ef92865a1cfab3d76b25aef086
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?php
/*
Plugin Name: Edmonton Ink Extension
Plugin URI: https://edmonton.ink/
Description: An Extension of JakeVan Base, for Edmonton ink.
Author: Jake Vanderwerf
Version: 1.0.0
Author URI: https://jakevan.ca/
Textdomain: aei
*/
 
if (!defined('ABSPATH')) {
    exit;
}
 
use JVBase\base\Site;
use JVBase\managers\CacheManager;
 
add_filter('jvb_base', function () {
    return 'aei_';
});
 
 
const AEI_DIR = WP_PLUGIN_DIR . '/edmontonink';
define('AEI_URL', plugin_dir_url(__FILE__));
 
 
add_filter('jvbChildDir', function() { return AEI_DIR; });
add_filter('jvbChildUrl', function() { return AEI_URL; });
 
require(AEI_DIR . '/content/_setup.php');
require(AEI_DIR . '/dashboard/_setup.php');
require(AEI_DIR . '/email/_setup.php');
require(AEI_DIR . '/forms/_setup.php');
require(AEI_DIR . '/login/_setup.php');
require(AEI_DIR . '/taxonomies/_setup.php');
require(AEI_DIR . '/users/_setup.php');
require(AEI_DIR . '/blocks/_setup.php');
require(AEI_DIR . '/seo.php');
//require(AEI_DIR . '/files/fileManagement.php');
 
add_action('plugins_loaded', 'aei_siteDefinition', 2);
add_action('jvbLoadDefinitions', 'aei_siteDefinition');
function aei_siteDefinition():void
{
    if (!class_exists('JVBase\base\Site')) {
        return;
    }
    $site = Site::getInstance();
    $site->set('icons', 'regular');
    $site->setAll([
        'is_directory',
        'membership',
        'dashboard',
        'magic_link',
        'feed_block',
        'favourites',
        'help_menu'
//        'has_map',
//        'referrals',
    ]);
    $site->setIntegrations([
        'cloudflare',
        'facebook',
        'gmb',
        'maps',
        'helcim',
        'postmark',
        'instagram',
        'umami'
    ]);
 
    $login = $site->login();
 
}
 
add_action('plugins_loaded', 'aei_membership_settings', 10);
function aei_membership_settings():void
{
    if (!class_exists('JVBase\base\Site')) {
        return;
    }
    $site = Site::getInstance();
    $membership = $site->membership();
    $membership->setAll([
        'invitable',
        'term_approval',
        'member_verified'
    ]);
 
    $membership->setInvitable([
        'artist'    => ['artist', 'enthusiast'],
        'enthusiast' => ['enthusiast']
    ]);
 
    $membership->setApprovers(['artist']);
    $membership->setCanSeeForum(['artist']);
}
 
 
//add_filter('jvbBelowHeader', 'aei_header');
//function aei_header(string $header):string
//{
//    return '<p>FREE LOCAL PICKUP at <a href="https://legacytattooremoval.ca/">Legacy Tattoo Removal</a>.</p>';
//}
 
 
 
add_filter('jvbMenuExtra', 'aei_contact_nav', 10, 3);
function aei_contact_nav(string $nav, string $menuName, array $block):string
{
    if (array_key_exists('attrs', $block)
        && array_key_exists('className', $block['attrs'])
        && $block['attrs']['className'] === 'is-style-fixed'
        && $nav === '') {
        $call = '<li class="call"><a href="'.jvbPhoneLink(8259257398).'" title="Call Us">'.jvbIcon('phone').'<span class="screen-reader-text">Call Us</span></a></li>';
        $text = '<li><a href="'.jvbTextLink(8259257398).'" title="Text Us">'.jvbIcon('chat').'<span class="hide-small">825.925.7398</span><sup class="hide-small">PEWU</sup></a></li>';
        $email = '<li><a href="'.jvbMailToLink(
            'info@legacytattooremoval.ca',
                'Contact from Our Website'
            ).'" title="Email Us">'.jvbIcon('envelope').'<span class="hide-small">info@legacytattooremoval.ca</span></a></li>';
 
        return $call.$text.$email;
    }
    if (array_key_exists('attrs', $block)
        && array_key_exists('className', $block['attrs'])
        && $block['attrs']['className'] === 'is-style-floating'
    ) {
        return $nav.'<li><ul class="socials">
            <li>
                <a href="https://www.facebook.com/madebymadimori/" target="_blank" rel="nofollow" title="Find us on Facebook">
                    '.jvbIcon('facebook-logo').'
                    <span class="screen-reader-text">
                        Find us on Facebook
                    </span>
                </a>
            </li>
            <li>
                <a href="https://www.instagram.com/madebymadimori" target="_blank" rel="nofollow" title="Find us on Instagram">
                    '.jvbIcon('instagram-logo').'
                    <span class="screen-reader-text">
                        Find us on Instagram
                    </span>
                </a>
            </li>
        </ul></li>';
    }
 
    return $nav;
}
 
add_filter('jvbBeforeFooter', 'alyns_acknowledgement');
function alyns_acknowledgement():string
{
 
    return '<p class="text-center">Respectfully, this land was <a href="https://edmonton.ink/amiskwaciwaskahikan/" data-type="page" data-id="4659">Amiskwaciwâskahikan</a> before it was ever Edmonton.</p>';
}
 
 
add_action('jvbBlockStyles', 'aei_blockStyles');
function aei_blockStyles()
{
    register_block_style(
        'core/list',
        [
            'name'=>'blocky',
            'label' => __('Blocky', 'aei')
        ]
    );
    register_block_style(
        'core/group',
        [
            'name'=>'triangle',
            'label' => __('Triangle', 'aei')
        ]
    );
}
 
 
add_filter('jvbRandomFooterText', 'aei_footer_text');
function aei_footer_text(string $text):string
{
    $aOpen = '<a href="https://legacytattooremoval.ca" title="Learn more about Legacy Tattoo Removal">';
    $options = array(
        [
            'text'      => 'Built with ♡ by '.$aOpen.'your friendly neighbourhood laser nerds</a>.',
            'weight'    => 25
        ],
        [
            'text'      => 'Built with ♡ by your friends at '.$aOpen.'Legacy Tattoo Removal</a>.',
            'weight'    => 15
        ],
        [
            'text'      => 'Your friendly '.$aOpen.'Edmonton tattoo removal</a> crew.',
            'weight'    => 15
        ],
        [
            'text'      => $aOpen.'tattoo removal with ♡</a>',
            'weight'    => 15
        ],
        [
            'text'      => 'From '.$aOpen.'cover ups to fresh starts</a> - we\'re the laser nerds with ♡.',
            'weight'    => 10
        ],
        [
            'text'      => $aOpen.'See the difference at Legacy Tattoo Removal</a>',
            'weight'    => 10
        ],
        [
            'text'      => 'Make space for your next tattoo at '.$aOpen.'Legacy Tattoo Removal</a>.',
            'weight'    => 10
        ],
        [
            'text'      => $aOpen.'We\'re your artist\'s secret weapon</a>.',
            'weight'    => 15
        ]
    );
        $totalWeight = 0;
        foreach ($options as $option) {
            $totalWeight += (int)$option['weight'];
        }
 
        $randomNumber = mt_rand(1, $totalWeight);
        $weightSum = 0;
 
        foreach ($options as $option) {
            $weightSum += (int)$option['weight'];
            if ($randomNumber <= $weightSum) {
                return '<p>'.$option['text'].'</p>';
            }
        }
 
    return '<p>'.$options[0]['text'].'</p>';
}
 
add_filter('jvbRegisterCustomIcons', 'aei_custom_icons');
function aei_custom_icons(array $icons):array
{
    $icons['logo'] = AEI_DIR . '/assets/icons/edmonton-ink-logo.svg';
    $icons['logo-text'] = AEI_DIR . '/assets/icons/edmonton-ink-circle.svg';
    return $icons;
}
add_filter('jvbMapIcons', 'aei_icons_map');
function aei_icons_map(array $icons):array
{
    return array_merge($icons, [
       'tattoo'     => 'drop-simple',
       'event'      => 'calendar',
       'piercing'   => 'needle',
       'artwork'    => 'palette',
       'artform'    => 'shapes',
       'city'       => 'map-pin',
        'piercing-type' => 'nut',
        'theme'     => 'folder-open',
        'style'     => 'hash',
        'colour'    => 'drop',
        'placement' => 'person-arms-spread',
        'media'     => 'squares-four',
        'artist'    => 'user',
        'artists'   => 'users-three',
        'partner'   => 'currency-circle-dollar',
        'shop'      => 'storefront',
        'past'      => 'clock-counter-clockwise',
        'future'    => 'clock-clockwise',
        'offer'     => 'hand-heart',
    ]);
}