Jake Vanderwerf
2026-05-11 aa974bf5954d0cca2506003a3cd9ec4eb89ed0bc
taxonomies/age.php
@@ -1,29 +1,124 @@
<?php
// /taxonomies/target.php
function altr_age():array
// /taxonomies/age.php
use JVBase\registrar\Registrar;
if (!defined('ABSPATH')) {
    exit;
}
add_action('jvbDefineRegistrar', 'altr_age');
add_action('jvbDefineRegistrarFields', 'altr_age_fields');
add_action('plugins_loaded', 'altr_age',1);
//Add fields later so we can verify taxonomies/post types exist
add_action('plugins_loaded', 'altr_age_fields', 2);
add_filter('altr_AgeSchemaDefault', 'altr_age_schema');
add_filter('altr_AgeMetaDefault', 'altr_age_meta');
add_filter('altr_AgeArchiveDefault', 'altr_age_archive');
function altr_age(){
    if (!class_exists('JVBase\registrar\Registrar')) {
        return;
    }
    $age = Registrar::forTerm('age', 'Age of Tattoo', 'Ages of Tattoo')
        ->setIcon('cake')
        ->make([
            'rewrite'   => [
                'slug'          => 'before-and-after/by/age',
                'with_front'    => false,
            ],
            'for'    => [
                'progress',
            ]
        ])
        ->setAll([
            'show_directory',
            'show_feed',
        ]);
//$directory = $age->getConfig('directory');
}
function altr_age_fields():void
{
    if (!class_exists('JVBase\registrar\Registrar')) {
        return;
    }
    $age = Registrar::getInstance('age');
    $fields = $age->fields();
    $fields->addCommon('wiki');
}
function altr_age_schema():array
{
    return [
        'singular'     => 'Age of Tattoo',
        'plural'       => 'Ages of Tattoo',
        'icon'         => 'cake',
        'show_feed'    => true,
        'rewrite'      => [
            'slug'         => 'age',
            'with_front'   => false,
            'hierarchical' => false,
        ],
        'hierarchical' => false,
        'for_content'  => [
            'progress',
        ],
        'fields'       => [
            'term_name' => [
                'label'     => 'Name',
                'type'      => 'text',
                'subtype'   => 'number',
                'quickEdit' => true,
            ],
            'common'    => [ 'wiki' ]
        ]
        'name'              => 'How to Remove a {{name}} Old Tattoo - Before & After',
    ];
}
function altr_age_meta():array
{
    return[
        'name'              => 'How to Remove a {{name}} Old Tattoo - Before & After',
        'description'       => 'See laser removal results on tattoos that are {{name}} old. Older ink often responds differently to treatment.'
    ];
}
function altr_age_archive(array $defaults):array
{
    return array_merge($defaults, [
        'name' => 'Removing {{term_name}} Old Tattoos – Before & After',
    ]);
}
function altr_age_reference_schema(array $defaults):array
{
    return $defaults;
}
//
//function altr_age():array
//{
//    return [
//        'singular'     => 'Age of Tattoo',
//        'plural'       => 'Ages of Tattoo',
//        'icon'         => 'cake',
//        'show_feed'    => true,
//        'show_directory'=> true,
//        'rewrite'      => [
//            'slug'         => 'before-and-after/by/age',
//            'with_front'   => false,
//            'hierarchical' => false,
//        ],
//        'hierarchical' => false,
//        'for_content'  => [
//            'progress',
//        ],
//        'seo' => [
//            'meta' => [
//                'title' => '{{term_name}} Old Tattoo Removal – Before & After',
//                'description' => 'See laser removal results on tattoos that are {{term_name}} old. Older ink often responds differently to treatment.',
//            ],
//            'schema' => [
//                'type' => 'CollectionPage',
//                'name' => '{{term_name}} Old Tattoo Removal Results',
//            ],
//            'archive' => [
//                'type' => 'CollectionPage',
//                'name' => 'Removing {{term_name}} Old Tattoos – Before & After',
//            ],
//        ],
//        'fields'       => [
//            'term_name' => [
//                'label'     => 'Name',
//                'type'      => 'text',
//                'subtype'   => 'number',
//                'quickEdit' => true,
//            ],
//            'common'    => [ 'wiki' ]
//        ]
//    ];
//}