$name, 'url' => $url, 'id' => $ID, 'extra' => $extra, ); return $list; } function jvbGetListTypes():array { $return = get_option(BASE.'list_types', false); if (!$return) { $directories = jvbGlobalDirectories(); $directories = array_merge($directories['content'],$directories['taxonomy']); foreach ($directories as $key => $directory) { $ID = jvbGetPageId($directory['page']); $directories[$key]['ID'] = $ID; $directories[$key]['url'] = get_the_permalink($ID); } $return = $directories; $mapID = jvbGetPageId('Map'); $url = get_the_permalink($mapID); $return[] = [ 'slug' => 'map', 'title' => 'Map', 'ID' => $mapID, 'url' => $url, 'page' => 'Map', 'type' => 'term', ]; update_option(BASE.'list_types', $return); } return $return; } function jvbDirectoryFrom(string|int|null $from, mixed $search):array { $directories = jvbGlobalDirectoryInfo(); $col = array_column($directories, $from); return $directories[array_search($search, $col)]; } function jvbGetDirectoryIntro(string $type):string { switch ($type) { case BASE.'artist': $intro = [ 'From old-school legends to fresh talent, here\'s your backstage pass to Edmonton\'s tattoo scene.', 'Every artist, every style. No algorithm. No BS. Just pure Edmonton ink.' ]; break; case BASE.'shop': $map = jvbGetPageId('Map'); $intro = [ 'The beating hearts of Edmonton\'s tattoo scene. Street by street, neighborhood by neighborhood.', 'Your map to Edmonton\'s best tattoo shops. Real spaces. Real artists. Real ink.', 'Want the actual map? Check it here.' ]; break; case BASE.'style': $intro = [ 'From traditional roots to bleeding-edge techniques.', 'This is your visual dictionary to tattoo styles in Edmonton. Because great tattoos start with knowing what you want.' ]; break; case BASE.'theme': $intro = [ 'Stories told in ink. Symbols that speak. Imagery that inspires.', 'Explore what\'s possible when Edmonton artists tackle your ideas. Different styles, same subject. Pure creative freedom.' ]; break; case BASE.'piercing': $intro = [ 'Beyond ink: piercings, spacers, and more. The next level of body art in Edmonton.', 'Your guide to professional body mod artists. Because your body is a canvas, and ink is just the beginning.' ]; break; case BASE.'artstyle': $intro = [ 'When tattoo artists break free from skin. Their personal styles, unleashed on canvas, walls, and beyond.', 'Where street meets gallery. Pure Edmonton creativity, no boundaries.' ]; break; case BASE.'arttheme': $intro = [ 'The subjects that drive Edmonton artists. From urban landscapes to surreal visions.', 'See how themes transform across mediums. Same story, different canvas.' ]; break; case BASE.'arttype': $intro = [ 'Sculpture to canvas, digital to print. Your tattoo artist\'s other obsessions.', 'Discover the full range of Edmonton\'s artistic underground. Every medium, every surface.' ]; break; case BASE.'artmedium': $intro = [ 'Tools of the trade beyond the machine. Paint, pixels, pencils, and everything between.', 'Browse art by medium. Because great artists never stop experimenting.' ]; break; case BASE.'partner': $intro = [ 'The brands and businesses that get it. Vetted by artists, trusted by the community.', 'Supporting Edmonton\'s tattoo scene. No sellouts, just solid connections.' ]; break; case BASE.'event': $intro = [ 'Flash days, guest spots, and exclusive drops from Edmonton\'s tattoo community.', 'Direct from the artists to you. No middleman, no markup, just pure opportunity.' ]; break; case BASE.'offer': $intro = [ 'Exclusive deals from the brands that support Edmonton\'s tattoo scene. Supplies, gear, merch, and more.', 'Community vetted, artist approved. Direct from our partners to your stash.' ]; break; default: $intro = []; break; } if (empty($intro)) { return ''; } return implode('', array_map(function ($paragraph) { return "
{$paragraph}
"; }, $intro)); } function jvbGetPageId(string $title):int { $page = new WP_Query( [ 'post_type' => 'page', 'title' => $title, 'posts_per_page' => 1, 'fields' => 'ids', ] ); wp_reset_postdata(); $result = ($page->have_posts()) ? $page->posts[0] : false; if (!$result) { $result = wp_insert_post([ 'post_title' => $title, 'post_type' => 'page', 'post_status' => 'publish', ]); } return $result; } function jvbLetters():array { return array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ); }