Jake Vanderwerf
3 hours ago ad01a2799464e36a3954abe14f84ab82d439da53
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
<?php
/*
Plugin Name: Lynsey Extension
Plugin URI: https://lynseyot.ca/
Description: An Extension of JakeVan Base, for Lynsey.
Author: Jake Vanderwerf
Version: 1.0.0
Author URI: https://jakevan.ca/
Textdomain: altr
*/
 
 
const ALYNS_DIR = WP_PLUGIN_DIR . '/alynsey';
define('ALYNS_URL', plugin_dir_url(__FILE__));
 
add_filter('jvb_base', function () {
    return 'alyns_';
});
 
 
require(ALYNS_DIR . '/forms/_setup.php');
require(ALYNS_DIR . '/email/_setup.php');
 
add_filter('jvbChildDir', function() {
    return ALYNS_DIR;
});
add_filter('jvbChildUrl', function() {
    return ALYNS_URL;
});
 
add_filter('jvb_site', 'altr_setup_site');
function altr_setup_site():array
{
    return [
        'icons'               => 'light',
        'is_directory'        => false,        //as in, a membership directory
        'has_membership'      => false,
        'has_map'             => false,
        'dashboard'           => false,
        'referrals'           => false,
        'magicLink'           => true,
        'support'         => false,
        'feed_block'      => false,
        'email_notifications' => false,
        'integrations'  => [
            'bluesky'     => false,
            'cloudflare'  => true,
            'facebook'    => false,
            'maps'        => false,
            'gmb'         => false,
            'helcim'      => false,
            'postmark'    => false,
            'instagram'   => false,
            'square'      => false,
            'umami'       => true,
        ],
    ];
}
 
add_filter('jvbRegisterCustomIcons', 'alyns_custom_icons');
function alyns_custom_icons(array $icons):array
{
    $icons['logo'] = ALYNS_DIR . '/assets/icons/otl.svg';
    return $icons;
}
 
add_filter('jvbIncludeIcons', 'alyns_include_icons');
function alyns_include_icons(array $icons):array
{
    $icons[] = 'brain';
    $icons[] = 'wheelchair';
    $icons[] = 'coffee';
    $icons[] = 'hard-hat';
    $icons[] = 'presentation';
    return $icons;
}
 
add_filter ('jvb_show_theme_switch', '__return_false');
 
function alyns_render_core_site_logo(array $block, string $content):string
{
    $open = $close = '';
 
    if (!is_home() && !is_front_page()) {
        $open = '<a href="'.get_home_url().'" rel="home">';
        $close = '</a>';
    }
    return $open.jvbIcon('logo').$close;
}
 
 
add_filter('jvbMenuExtra', 'alyns_contact_nav', 10, 3);
function alyns_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(8259062682).'" title="Call Us">'.jvbIcon('phone').'<span class="screen-reader-text">Call Me</span></a></li>';
        $text = '<li><a href="'.jvbTextLink(8259062682).'" title="Text Me">'.jvbIcon('chat').'<span class="hide-small">825.906.2682</span></a></li>';
        $email = '<li><a href="'.jvbMailToLink(
                'otlynsey@gmail.com',
                'Contact from Website'
            ).'" title="Email Me">'.jvbIcon('envelope').'<span class="hide-small">otlynsey@gmail.com</span></a></li>';
 
        return $call.$text.$email;
    }
    return $nav;
}