| File was renamed from alegacy.php |
| | |
| | | <?php |
| | | /* |
| | | Plugin Name: Legacy Extension |
| | | Plugin URI: https://legacytattooremoval.ca/ |
| | | Description: An Extension of JakeVan Base, for Legacy Tattoo Removal. |
| | | Plugin Name: Tatty Soap Extension |
| | | Plugin URI: https://tattysoap.ca/ |
| | | Description: An Extension of JakeVan Base, for Tatty Soap. |
| | | Author: Jake Vanderwerf |
| | | Version: 1.0.0 |
| | | Author URI: https://jakevan.ca/ |
| | | Textdomain: altr |
| | | Textdomain: atat |
| | | */ |
| | | |
| | | //PLUGIN STRUCTURE |
| | | // /content/ |
| | | // art.php |
| | | // design.php |
| | | // development.php |
| | | // _setup.php |
| | | // strategy.php |
| | | // writing.php |
| | | // /dashboard/ |
| | | // _setup.php |
| | | // /files/ |
| | | // fileManagement.php |
| | | // /forms/ |
| | | // _setup.php |
| | | // /login/ |
| | | // _setup.php |
| | | // /taxonomies/ |
| | | // city.php |
| | | // form.php |
| | | // media.php |
| | | // progress.php |
| | | // _setup.php |
| | | // style.php |
| | | // target.php |
| | | // theme.php |
| | | // /users/ |
| | | // client.php |
| | | // _setup.php |
| | | // ajakevan.php <-- main plugin file |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | |
| | | use JVBase\managers\CacheManager; |
| | | |
| | | add_filter('jvb_base', function () { |
| | | return 'altr_'; |
| | | return 'atat_'; |
| | | }); |
| | | |
| | | |
| | | const AJV_DIR = WP_PLUGIN_DIR . '/alegacy'; |
| | | define('AJV_URL', plugin_dir_url(__FILE__)); |
| | | const ATAT_DIR = WP_PLUGIN_DIR . '/atatty'; |
| | | define('ATAT_URL', plugin_dir_url(__FILE__)); |
| | | |
| | | require(AJV_DIR . '/content/_setup.php'); |
| | | require(AJV_DIR . '/dashboard/_setup.php'); |
| | | require(AJV_DIR . '/email/_setup.php'); |
| | | require(AJV_DIR . '/forms/_setup.php'); |
| | | require(AJV_DIR . '/login/_setup.php'); |
| | | require(AJV_DIR . '/taxonomies/_setup.php'); |
| | | require(AJV_DIR . '/users/_setup.php'); |
| | | //require(AJV_DIR . '/files/fileManagement.php'); |
| | | require(ATAT_DIR . '/content/_setup.php'); |
| | | require(ATAT_DIR . '/dashboard/_setup.php'); |
| | | require(ATAT_DIR . '/email/_setup.php'); |
| | | require(ATAT_DIR . '/forms/_setup.php'); |
| | | require(ATAT_DIR . '/login/_setup.php'); |
| | | require(ATAT_DIR . '/taxonomies/_setup.php'); |
| | | require(ATAT_DIR . '/users/_setup.php'); |
| | | //require(ATAT_DIR . '/files/fileManagement.php'); |
| | | |
| | | |
| | | /** |
| | |
| | | * - rewrite rules |
| | | * - archive title |
| | | */ |
| | | add_filter('jvb_site', 'altr_setup_site'); |
| | | function altr_setup_site():array |
| | | add_filter('jvb_site', 'atat_setup_site'); |
| | | function atat_setup_site():array |
| | | { |
| | | return [ |
| | | 'icons' => 'light', |
| | | 'is_directory' => true, //as in, a membership directory |
| | | 'is_directory' => false, //as in, a membership directory |
| | | 'has_membership' => false, |
| | | 'has_map' => true, |
| | | 'dashboard' => true, |
| | | 'referrals' => true, |
| | | 'magicLink' => true, |
| | | 'support' => false, |
| | | 'feed_block' => true, |
| | | 'feed_block' => false, |
| | | 'email_notifications' => false, |
| | | 'integrations' => [ |
| | | 'bluesky' => true, |
| | | 'bluesky' => false, |
| | | 'cloudflare' => true, |
| | | 'facebook' => true, |
| | | 'maps' => true, |
| | |
| | | * - term_approval = (bool) verified users can create new terms, but needs approval |
| | | * - member_only = (array) if empty, open to any registered user. otherwise an array of registered user roles |
| | | */ |
| | | //add_filter('jvb_membership', 'altr_setup_membership'); |
| | | //function altr_setup_membership():array |
| | | //add_filter('jvb_membership', 'atat_setup_membership'); |
| | | //function atat_setup_membership():array |
| | | //{ |
| | | // return [ |
| | | // 'member_content' => true, |
| | |
| | | // ]; |
| | | //} |
| | | // |
| | | //add_filter('jvbLoadingQuips', 'altr_loading_quips'); |
| | | //function altr_loading_quips(array $quips):array |
| | | //add_filter('jvbLoadingQuips', 'atat_loading_quips'); |
| | | //function atat_loading_quips(array $quips):array |
| | | //{ |
| | | // return []; |
| | | //} |
| | | |
| | | |
| | | add_filter('jvbAboveHeader', 'altr_legacy_header'); |
| | | function altr_legacy_header(string $header):string |
| | | //add_filter('jvbAboveHeader', 'atat_header'); |
| | | function atat_legacy_header(string $header):string |
| | | { |
| | | return '<p><b>WED - SUN</b> <span class="hide-small"> </span>10<span class="hide-small">:00</span>AM - 6<span class="hide-small">:00</span>PM</p><p>By Appointment<span class="hide-small"> Only</span></p>'; |
| | | } |
| | | |
| | | |
| | | |
| | | add_filter('jvbMenuExtra', 'altr_contact_nav', 10, 3); |
| | | function altr_contact_nav(string $nav, string $menuName, array $block):string |
| | | add_filter('jvbMenuExtra', 'atat_contact_nav', 10, 3); |
| | | function atat_contact_nav(string $nav, string $menuName, array $block):string |
| | | { |
| | | if (array_key_exists('attrs', $block) |
| | | && array_key_exists('className', $block['attrs']) |
| | |
| | | ) { |
| | | return $nav.'<li><ul class="socials"> |
| | | <li> |
| | | <a href="https://www.facebook.com/LegacyTattooRemoval/" target="_blank" rel="nofollow" title="Find us on Facebook"> |
| | | <a href="https://www.facebook.com/tatty.soap/" target="_blank" rel="nofollow" title="Find us on Facebook"> |
| | | '.jvbIcon('facebook-logo').' |
| | | <span class="screen-reader-text"> |
| | | Find us on Facebook |
| | |
| | | </a> |
| | | </li> |
| | | <li> |
| | | <a href="https://www.instagram.com/LegacyTattooRemoval/" target="_blank" rel="nofollow" title="Find us on Instagram"> |
| | | <a href="https://www.instagram.com/tatty.soap" target="_blank" rel="nofollow" title="Find us on Instagram"> |
| | | '.jvbIcon('instagram-logo').' |
| | | <span class="screen-reader-text"> |
| | | Find us on Instagram |
| | | </span> |
| | | </a> |
| | | </li> |
| | | <li> |
| | | <a href="https://bsky.app/profile/legacyrebrand.test" target="_blank" rel="nofollow" title="Find us on Bluesky"> |
| | | '.jvbIcon('butterfly').' |
| | | <span class="screen-reader-text"> |
| | | Find us on Bluesky |
| | | </span> |
| | | </a> |
| | | </li> |
| | | </ul></li>'; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | add_action('jvbBlockStyles', 'altr_blockStyles'); |
| | | function altr_blockStyles() |
| | | add_action('jvbBlockStyles', 'atat_blockStyles'); |
| | | function atat_blockStyles() |
| | | { |
| | | register_block_style( |
| | | 'core/list', |
| | | [ |
| | | 'name'=>'blocky', |
| | | 'label' => __('Blocky', 'altr') |
| | | 'label' => __('Blocky', 'atat') |
| | | ] |
| | | ); |
| | | register_block_style( |
| | | 'core/group', |
| | | [ |
| | | 'name'=>'triangle', |
| | | 'label' => __('Triangle', 'altr') |
| | | 'label' => __('Triangle', 'atat') |
| | | ] |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | function altr_render_core_post_excerpt(array $block, string $content) |
| | | { |
| | | |
| | | global $post; |
| | | if (!has_excerpt($post)) { |
| | | return ''; |
| | | } |
| | | $excerpt = $post->post_excerpt; |
| | | |
| | | $before = is_singular() ? '<span class="tldr" title="Too Long, Didn\'t Read">TLDR:</span>' : ''; |
| | | $excerpt = $before.$excerpt; |
| | | return '<div class="excerpt">'.apply_filters('the_content', $excerpt).'</div>'; |
| | | } |
| | | |
| | | add_action( 'init', 'altr_add_excerpts_to_pages' ); |
| | | function altr_add_excerpts_to_pages() { |
| | | add_post_type_support( 'page', 'excerpt' ); |
| | | } |