Jake Vanderwerf
4 days ago 5a6906f710e9333507486df3cbb545a67a040881
=Minor changes to email.php, which had info for Legacy and edmonton.ink hardcoded in it. Added a colours.php and JVB_COLOURS constant to define our base, contrast, action, and secondary colours for use within php templates
6 files modified
1 files added
86 ■■■■ changed files
base/_setup.php 1 ●●●● patch | view | raw | blame | history
base/colours.php 26 ●●●●● patch | view | raw | blame | history
base/email.php 37 ●●●● patch | view | raw | blame | history
inc/helpers/legacy.php 2 ●●● patch | view | raw | blame | history
inc/managers/DirectoryManager.php 5 ●●●●● patch | view | raw | blame | history
inc/managers/EmailManager.php 4 ●●●● patch | view | raw | blame | history
inc/managers/SEO/BreadcrumbManager.php 11 ●●●●● patch | view | raw | blame | history
base/_setup.php
@@ -10,6 +10,7 @@
    Site::getInstance();
}
//require(JVB_DIR.'/base/content.php');
require(JVB_DIR.'/base/colours.php');
require(JVB_DIR.'/base/email.php');
//require(JVB_DIR.'/base/taxonomies.php');
//require(JVB_DIR.'/base/users.php');
base/colours.php
New file
@@ -0,0 +1,26 @@
<?php
$defaults = [
    'action-0'      => '#ff0080',
    'action-50'     => '#ff2492',
    'action-100'    => '#ff47a4',
    'action-200'    => '#ff6bb5',
    'secondary-0'   => '#D69121',
    'secondary-50'  => '#ffc421',
    'secondary-100' => '#ffcd44',
    'secondary-200' => '#ffd768',
    'light'         => '#efefef',
    'light-50'      => '#e2e2e2',
    'light-100'     => '#d5d5d5',
    'light-200'     => '#c9c9c9',
    'dark'          => '#151515',
    'dark-50'       => '#222222',
    'dark-100'      => '#2e2e2e',
    'dark-200'      => '#3b3b3b',
    'action-contrast'=> '',
    'secondary-contrast'=> '',
];
$jvbColours = apply_filters('jvb_colours', $defaults);
define('JVB_COLOURS', $jvbColours);
base/email.php
@@ -1,37 +1,22 @@
<?php
$name = get_bloginfo('name');
$desc = get_bloginfo('description');
$defaults = [
    'colours'       => [
        'action-0'      => '#ff0080',
        'action-50'     => '#ff2492',
        'action-100'    => '#ff47a4',
        'action-200'    => '#ff6bb5',
        'secondary-0'   => '#D69121',
        'secondary-50'  => '#ffc421',
        'secondary-100' => '#ffcd44',
        'secondary-200' => '#ffd768',
        'light'         => '#efefef',
        'light-50'      => '#e2e2e2',
        'light-100'     => '#d5d5d5',
        'light-200'     => '#c9c9c9',
        'dark'          => '#151515',
        'dark-50'       => '#222222',
        'dark-100'      => '#2e2e2e',
        'dark-200'      => '#3b3b3b',
        'action-contrast'=> '',
        'secondary-contrast'=> '',
    ],
    'content'       => [
        'title'             => get_bloginfo('name'),
        'subjectPrefix'     => '['.get_bloginfo('name').']',
        'signature'         => '<p>&emsp; —  ♡ the edmonton.ink crew</p>',
        'title'             => $name,
        'subjectPrefix'     => '['.$name.']',
        'signature'         => '<p>&emsp; —  ♡ '.$name.'</p>',
        'footer'    => [
            '<p>&copy; ' . date('Y') . ' edmonton.ink — Your tattoo scene on your screen.</p>',
            '<p><a href="' . get_home_url() . '" class="text-link">edmonton.ink</a></p>'
            '<p>&copy; ' . date('Y') . ' '.$name.' — '.$desc.'</p>',
            '<p><a href="' . get_home_url() . '" class="text-link">'.get_home_url().'</a></p>'
        ]
    ],
    'types' => [
        'newUser' => [
            'subject'       => 'Welcome to Legacy! Finish creating your account.',
            'subject'       => sprintf(
                'Welcome to %s! Finish creating your account.',
                get_bloginfo('name')
            ),
            'showPrefix'    => true,
        ],
        'resetPass' => [
inc/helpers/legacy.php
@@ -13,7 +13,7 @@
{
    $privacy = get_privacy_policy_url();
    $privacy = ($privacy === '') ? '' : ' | <a href="'.$privacy.'">Privacy Policy</a>';
    return apply_filters('jvbRandomFooterText', '<p class="font-small">©'.date('Y').' <a href="'.get_home_url().'">'.get_bloginfo('name').'</a>'.$privacy.'</p><p class="font-small">Built with ♡ by <a href="https://jakevan.ca">Jake Van</a></p>');
    return apply_filters('jvbRandomFooterText', '<p class="font-small">©'.date('Y').' <a href="'.get_home_url().'">'.get_bloginfo('name').'</a>'.$privacy.'</p><p class="font-small">Built with ♡ by <a href="https://jakevan.ca?ref='.urlencode(get_home_url()).'">Jake Van</a></p>');
//
//  $aOpen = '<a href="https://legacytattooremoval.ca" title="Learn more about Legacy Tattoo Removal">';
//  $options = array(
inc/managers/DirectoryManager.php
@@ -85,6 +85,7 @@
    public function getDirectories():array
    {
        $directories = get_option(BASE.'directories');
        if (!$directories) {
            $directories = [];
            //content
@@ -134,7 +135,7 @@
            $title = $config['title'];
            //Bail early if we've already created the page
            $existing = new WP_Query([
                'post_type' => BASE.'dash',
                'post_type' => BASE.'directory',
                'name'  => sanitize_title($title),
                'posts_per_page'    => 1,
            ]);
@@ -228,7 +229,6 @@
//                ];
//            }
//        }
        if (!empty($created)) {
            update_option(BASE.'directory_ids', $created);
        }
@@ -240,6 +240,7 @@
    protected function buildDirectoryList():array
    {
        $saved = get_option(BASE.'directory_list', []);
        if (empty($saved)) {
            $all = new WP_Query([
                'post_type' => BASE.'directory',
inc/managers/EmailManager.php
@@ -24,7 +24,7 @@
class EmailManager
{
   public array $colours = JVB_EMAIL['colours'];
   public array $colours;
   private string $title = JVB_EMAIL['content']['title'];
   private string $prefix = JVB_EMAIL['content']['subjectPrefix'];
   private string $signature = JVB_EMAIL['content']['signature'];
@@ -42,7 +42,7 @@
        $this->site_name = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
        $this->site_url = get_site_url();
        $this->footer = (is_array(JVB_EMAIL['content']['footer'])) ? implode('', JVB_EMAIL['content']['footer']) : JVB_EMAIL['content']['footer'];
        $this->colours = JVB_COLOURS;
        add_filter('wp_mail_content_type', [$this, 'setHtmlContentType']);
        // User registration emails
        add_filter('wp_new_user_notification_email', [$this, 'customizeNewUserEmail'], 999, 3);
inc/managers/SEO/BreadcrumbManager.php
@@ -172,16 +172,6 @@
            $crumbConfig = $registrar->getConfig('breadcrumbs');
        }
        if($registrar && $registrar->hasFeature('show_directory')) {
            $directory = JVB()->directories();
            if ($directory && !empty($directory->directories($content)??[])){
                $crumbs[] = [
                    'name'  => $directory->directories($content)['title'],
                    'url'   =>$directory->directories($content)['url']
                ];
            }
        }
        // Handle directory posts specially
        if (JVB()->directories() && JVB()->directories()->isDirectory()) {
            $pos = jvbGetDirectoryInfo();
@@ -226,6 +216,7 @@
        if($registrar && $registrar->hasFeature('show_directory') && JVB()->directories()) {
            $directory = JVB()->directories();
            if ($directory && !empty($directory->directories($name)??[])){
                $crumbs[] = [
                    'name'  => $directory->directories($name)['title'],