| | |
| | | exit; |
| | | } |
| | | |
| | | use JVBase\base\Site; |
| | | use JVBase\managers\CacheManager; |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | add_filter('jvb_base', function () { |
| | | return 'altr_'; |
| | |
| | | require(AJV_DIR . '/login/_setup.php'); |
| | | require(AJV_DIR . '/taxonomies/_setup.php'); |
| | | require(AJV_DIR . '/users/_setup.php'); |
| | | require(AJV_DIR . '/blocks/_setup.php'); |
| | | require(AJV_DIR . '/seo.php'); |
| | | //require(AJV_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', 'light'); |
| | | $site->setAll([ |
| | | 'is_directory', |
| | | 'dashboard', |
| | | 'magic_link', |
| | | 'feed_block', |
| | | // 'faq', |
| | | 'referrals' |
| | | // 'has_map', |
| | | // 'referrals', |
| | | ]); |
| | | $site->setIntegrations([ |
| | | 'cloudflare', |
| | | 'facebook', |
| | | 'gmb', |
| | | 'maps', |
| | | 'helcim', |
| | | 'postmark', |
| | | 'instagram', |
| | | 'umami' |
| | | ]); |
| | | |
| | | $login = $site->login(); |
| | | $site->setDirectorySingular('List'); |
| | | $site->setDirectoryPlural('Lists'); |
| | | |
| | | |
| | | } |
| | | |
| | | //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']); |
| | | //} |
| | | |
| | | /** |
| | | * Defines base options like: |
| | | * - directory & Membership |
| | |
| | | { |
| | | return [ |
| | | 'icons' => 'light', |
| | | 'is_directory' => false, //as in, a membership directory |
| | | 'is_directory' => true, //as in, a membership directory |
| | | 'directory_label' => ['List', 'Lists'], |
| | | 'has_membership' => false, |
| | | 'has_map' => true, |
| | | 'dashboard' => true, |
| | | 'faq' => true, |
| | | 'referrals' => true, |
| | | 'magicLink' => true, |
| | | 'support' => false, |
| | |
| | | </a> |
| | | </li> |
| | | <li> |
| | | <a href="https://bsky.app/profile/legacyrebrand.test" target="_blank" rel="nofollow" title="Find us on Bluesky"> |
| | | <a href="https://bsky.app/profile/legacytattooremoval.ca" target="_blank" rel="nofollow" title="Find us on Bluesky"> |
| | | '.jvbIcon('butterfly').' |
| | | <span class="screen-reader-text"> |
| | | Find us on Bluesky |
| | |
| | | |
| | | |
| | | |
| | | 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" data-short="TLDR:" data-long="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() { |
| | |
| | | return 'logo-triangle'; |
| | | } |
| | | |
| | | function altr_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.'<span class="logo">'.jvbIcon('logo-triangle').jvbIcon('logo-text-only').'</span>'.$close; |
| | | } |
| | | |
| | | add_filter('jvbSummaryHeader', 'altr_progress_summary_header', 10, 2); |
| | | |
| | |
| | | { |
| | | switch ($type) { |
| | | case 'progress': |
| | | return JVB_CONTENT[$type]['plural']; |
| | | return Registrar::getInstance($type)->getPlural(); |
| | | default: |
| | | $obj = get_queried_object(); |
| | | return '<small>Before & After Laser Tattoo Removal</small><small>'.JVB_TAXONOMY[$type]['singular'].':</small>'.str_replace(JVB_TAXONOMY[$type]['singular'].': ','',$title); |
| | | $singular = Registrar::getInstance($type)->getSingular(); |
| | | return '<small>Before & After Laser Tattoo Removal</small><small>'.$singular.':</small>'.str_replace($singular.': ','',$title); |
| | | } |
| | | } |
| | | add_filter('jvbSummaryHeaderExtra', 'altr_progress_summary_header_extra', 10, 2); |
| | |
| | | // return $sections; |
| | | //} |
| | | |
| | | add_filter('render_block', 'altr_tldr_script', 10, 2); |
| | | function altr_tldr_script($content, $block) { |
| | | if ($block['blockName'] === 'core/post-excerpt') { |
| | | add_action('wp_footer', function() { |
| | | ?> |
| | | <script> |
| | | document.addEventListener('DOMContentLoaded', function() { |
| | | const tldrElements = document.querySelectorAll('.tldr'); |
| | | |
| | | tldrElements.forEach(function(el) { |
| | | let isExpanded = false; |
| | | |
| | | el.addEventListener('click', function(e) { |
| | | e.preventDefault(); |
| | | isExpanded = !isExpanded; |
| | | window.eraseText(el, 5).then(() => window.typeText(el, isExpanded ? this.dataset.long : this.dataset.short)); |
| | | el.classList.remove('typeText'); |
| | | }); |
| | | }); |
| | | }); |
| | | </script> |
| | | <?php |
| | | },999); |
| | | } |
| | | return $content; |
| | | } |
| | | |
| | | add_filter('the_seo_framework_meta_render_data', 'altr_no_next_archive', 10, 1); |
| | | function altr_no_next_archive($tags) { |
| | | if (is_post_type_archive(BASE.'progress') || is_post_type_archive(BASE.'terms') || is_post_type_archive(BASE.'faq')) { |
| | | if (is_tax() || is_post_type_archive('altr_progress') || is_post_type_archive('altr_terms') || is_post_type_archive('altr_faq')) { |
| | | if (array_key_exists('next', $tags)) { |
| | | unset($tags['next']); |
| | | } |
| | |
| | | function altr_estimate_link(string $link):string |
| | | { |
| | | return 'https://legacytattooremoval.ca/get-an-estimate/'; |
| | | } |
| | | |
| | | add_filter('jvbLogoIcon', 'altr_logostring'); |
| | | function altr_logostring():string |
| | | { |
| | | return 'logo-triangle'; |
| | | } |
| | | |
| | | add_filter('jvbDefaultIcon', 'altr_default_icon'); |
| | | function altr_default_icon():string |
| | | { |
| | | return 'triangle'; |
| | | } |
| | | |
| | | add_action('init', 'altr_RegisterScripts', 5); |
| | | |
| | | function altr_RegisterScripts() { |
| | | wp_enqueue_script( |
| | | 'altr-base', |
| | | AJV_URL.'assets/js/legacy.js', |
| | | [], |
| | | '1.0', |
| | | [ |
| | | 'strategy' => 'defer', |
| | | 'in_footer' => true |
| | | ] |
| | | ); |
| | | } |