<?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;
|
}
|