set('icons', 'light'); $site->setAll([ 'is_directory', 'dashboard', 'magic_link', 'feed_block', 'support', // 'faq', 'referrals' // 'has_map', // 'referrals', ]); $site->setIntegrations([ 'cloudflare', // 'facebook', 'gmb', 'maps', 'helcim', 'postmark', // 'instagram', 'umami' ]); $login = $site->login(); $site->setDirectorySingular('List'); $site->setDirectoryPlural('Lists'); } /** * Defines base options like: * - directory & Membership * - dashboard * - membership settings (JVB_MEMBERSHIP) * - post types (JVB_CONTENT) * - taxonomies (JVB_TAXONOMY) * - User Roles (JVB_USER) * - enthusiast = (bool) short form for a subscriber-like user that can collect content for reference * - forum = (bool) create a forum * - member_only = (bool) if forum and this is true, creates a member-only forum in the custom dashboard * * as well as central filters for * - rewrite rules * - archive title */ //add_filter('jvb_site', 'ajv_setup_site'); function ajv_setup_site():array { return [ 'icons' => 'light', 'is_directory' => true, //as in, a membership directory 'directory_label' => ['List', 'Lists'], 'has_membership' => false, // 'has_map' => true, 'dashboard' => true, 'support' => true, 'feed_block' => true, 'email_notifications' => true, 'integrations' => [ 'bluesky' => true, 'cloudflare' => true, 'facebook' => false, 'maps' => true, 'gmb' => true, 'helcim' => true, 'instagram' => false, 'square' => false, 'umami' => true, 'postmark' => true, ], 'is_restaurant' => false, 'limit_hours' => false, 'enthusiast' => true, 'favourites' => false, //optional flag to allow enthusiasts, but not favourites ]; } /** * JVB_MEMBERSHIP defines the structure of the directory * Options include: * - membership_expires = useful if members pay a yearly membership fee * - hide_expired = removes users once membership expired; only used if membership_expires is true * - clip_expired = keeps users once membership expires, but limits the information shown; only used if membership_expires is true * - membership_approval = verified users can approve other users * - 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', 'ajv_setup_membership'); //function ajv_setup_membership():array //{ // return [ // 'member_content' => true, // 'can_invite' => ['artist' => ['artist']], // 'member_verified' => true, // 'notifications' => true, // 'forum' => true, // 'member_only' => [ 'artist' ], // 'member_expires' => false, // 'hide_expired' => false, // 'clip_expired' => false, // 'term_approval' => true, // 'can_approve' => [ 'artist' ] // ]; //} // //add_filter('jvbLoadingQuips', 'ajv_loading_quips'); //function ajv_loading_quips(array $quips):array //{ // return []; //} add_filter('jvbLoadingIcon', 'ajv_loading_icon', 999999); function ajv_loading_icon():string { return 'loading'; } add_filter('jvbDrawerItems', 'jvDrawerItems', 10, 2); function jvDrawerItems(array $items, string $menuID):array { if ($menuID !== 'main') { return $items; } $items = [ [ 'text' => 'About Jake', 'url' => home_url('/about'), 'icon' => 'user-square', ] ]; foreach (Registrar::getRegistered('post') as $slug) { $registrar = Registrar::getInstance($slug); if (!$registrar || !$registrar->registrar->public) { continue; } $items[] = [ 'text' => $registrar->getSingular(), 'url' => get_post_type_archive_link(BASE.$slug), 'icon' => $registrar->getIcon(), 'class' => $slug, ]; } $items[] = [ 'text' => 'Contact', 'icon' => 'chat-teardrop', 'url' => home_url('/contact'), ]; // $items[] = [ // 'text' => 'Account', // 'url' => home_url('/dash'), // 'icon' => 'user-circle', // ]; return $items; } add_filter('jvbBeforeFooter', 'ajv_acknowledgement'); function ajv_acknowledgement():string { return '
I live and work in amiskwacîwâskahikan ᐊᒥᐢᑲᐧᒋᐋᐧᐢᑲᐦᐃᑲᐣ
Edmonton, Alberta, Canada
'; } add_filter('jvbRegisterCustomIcons', 'ajv_custom_icons'); function ajv_custom_icons(array $icons):array { $icons['logo'] = AJV_DIR . '/assets/icons/logo-concentric.svg'; $icons['logo-jakevan'] = AJV_DIR . '/assets/icons/logo-concentric-jakevan.svg'; $icons['logo-right'] = AJV_DIR . '/assets/icons/logo-right-aligned.svg'; $icons['logo-right-jakevan'] = AJV_DIR . '/assets/icons/logo-right-aligned-jakevan.svg'; $icons['jakevan'] = AJV_DIR . '/assets/icons/jakevan.svg'; $icons['loading'] = AJV_DIR . '/assets/icons/loading.svg'; // $icons['art'] = AJV_DIR . '/assets/icons/jakevan-does-art.svg'; // $icons['design'] = AJV_DIR . '/assets/icons/jakevan-does-design.svg'; // $icons['development'] = AJV_DIR . '/assets/icons/jakevan-does-development.svg'; // $icons['project'] = AJV_DIR . '/assets/icons/jakevan-does-project.svg'; // $icons['strategy'] = AJV_DIR . '/assets/icons/jakevan-does-strategy.svg'; // $icons['writing'] = AJV_DIR . '/assets/icons/jakevan-does-writing.svg'; return $icons; } add_filter('jvbMenuExtra', 'ajv_contact_nav', 10, 3); function ajv_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 === '') { $text = sprintf( '©'.date('Y').' '.get_bloginfo('name').''.$privacy.' | Terms of Service
Built with ♡ by Jake Van (of course!)
'; } add_filter('jvbSummaryHeader', 'ajv_summary_header', 10, 2); function ajv_summary_header(string $return, string $type):string { $extra = match($type) { 'strategy' => 'Edmonton-focused brand', 'project' => 'Edmonton-based', default => 'Edmonton made' }; $title = ($type === 'directory') ? 'Directory' : Registrar::getInstance($type)->getSingular(); return ''.$extra.''.$title.'.'; } add_filter('jvbSummaryHeaderExtra', 'ajv_summary_extra', 10, 2); function ajv_summary_extra(string $return, string $type):string { return ($type === 'directory') ? '' : 'Or see alphabetical list.
'; } function ajv_prerender_core_post_content(array $block, ?string $content, ?WP_Block $parent):?string { if(!is_singular(array_map(function($item) { return BASE.$item; }, Registrar::getRegistered('post')))) { return null; } $postType = jvbNoBase(get_post_type()); $function = "ajv_prerender_{$postType}_content"; $base = ''; if (function_exists($function)) { $base = $function($block,$content,$parent); } return $base; // return $base.JVB()->blocks()->prerender_core_post_content($block, $content, $parent); } add_filter('the_seo_framework_meta_render_data', 'ajvb_no_next_archive', 10, 1); function ajvb_no_next_archive($tags) { if (is_tax() || is_post_type_archive()) { if (array_key_exists('next', $tags)) { unset($tags['next']); } } return $tags; // Keep the link for other pages } add_filter('jvbSummaryDetailsOutput', 'ajvb_summary_info',10, 1); function ajvb_summary_info(string $return):string { if (!is_singular(array_map(function($item) { return BASE.$item;}, Registrar::getRegistered('post')))) { return $return; } $return = ajvb_term_list(); $return .= ajvb_meta_output(); return $return; } function ajvb_term_list():string { if (empty(Registrar::getRegistered('term'))){ return ''; } $ID = get_the_ID(); $type = jvbNoBase(get_post_type($ID)); $registrar = Registrar::getInstance($type); $taxonomies = $registrar->registrar->taxonomies; $lists = []; foreach ($taxonomies as $taxonomy) { $baseless = jvbNoBase($taxonomy); $taxRegistrar = Registrar::getInstance($baseless); $terms = wp_get_object_terms($ID, $taxonomy); if ($terms && !is_wp_error($terms)) { $list = sprintf( '