| | |
| | | <?php |
| | | // /taxonomies/progress.php |
| | | function altr_timeline():array |
| | | // /taxonomies/timeline.php |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | add_action('jvbDefineRegistrar', 'altr_timeline'); |
| | | add_action('jvbDefineRegistrarFields', 'altr_timeline_fields'); |
| | | add_action('plugins_loaded', 'altr_timeline',1); |
| | | //Add fields later so we can verify taxonomies/post types exist |
| | | add_action('plugins_loaded', 'altr_timeline_fields', 2); |
| | | |
| | | add_filter('altr_TimelineSchemaDefault', 'altr_timeline_schema'); |
| | | add_filter('altr_TimelineMetaDefault', 'altr_timeline_meta'); |
| | | add_filter('altr_TimelineArchiveDefault', 'altr_timeline_archive'); |
| | | |
| | | function altr_timeline(){ |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $timeline = Registrar::forTerm('timeline', 'Timeline', 'Timelines') |
| | | ->setIcon('hourglass') |
| | | ->make([ |
| | | 'rewrite' => [ |
| | | 'slug' => 'before-and-after/by/timeline', |
| | | 'with_front' => false, |
| | | ], |
| | | 'description' => 'Complete tattoo removal or fading for a cover up tattoo (or unknown)', |
| | | 'hierarchical' => false, |
| | | 'for' => [ |
| | | 'progress', |
| | | ], |
| | | ]) |
| | | ->setAll([ |
| | | 'show_directory', |
| | | 'show_feed', |
| | | ]); |
| | | |
| | | //$directory = $timeline->getConfig('directory'); |
| | | |
| | | } |
| | | |
| | | function altr_timeline_fields():void |
| | | { |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $timeline = Registrar::getInstance('timeline'); |
| | | |
| | | $fields = $timeline->fields(); |
| | | $fields->addCommon('wiki'); |
| | | } |
| | | |
| | | function altr_timeline_schema():array |
| | | { |
| | | return [ |
| | | 'singular' => 'Timeline', |
| | | 'plural' => 'Timelines', |
| | | 'icon' => 'hourglass', |
| | | 'show_feed' => true, |
| | | 'show_directory' => true, |
| | | 'rewrite' => [ |
| | | 'slug' => 'before-and-after/by/timeline', |
| | | 'with_front' => false, |
| | | ], |
| | | 'for_content' => [ |
| | | 'progress', |
| | | ], |
| | | 'fields' => [ |
| | | 'term_name' => [ |
| | | 'label' => 'Name', |
| | | 'type' => 'text', |
| | | 'quickEdit' => true, |
| | | ], |
| | | 'common' => [ 'wiki' ] |
| | | ] |
| | | 'name' => '{{name}} Between Treatments | Tattoo Removal Progress', |
| | | ]; |
| | | } |
| | | |
| | | function altr_timeline_meta():array |
| | | { |
| | | return[ |
| | | 'name' => '{{name}} Between Treatments | Tattoo Removal Progress', |
| | | 'description' => 'See how tattoos heal and fade with {{name}} between laser removal sessions.', |
| | | ]; |
| | | } |
| | | |
| | | function altr_timeline_archive(array $defaults):array |
| | | { |
| | | return array_merge($defaults, [ |
| | | 'name' => '{{name}} Between Treatments | Tattoo Removal Progress', |
| | | ]); |
| | | } |
| | | |
| | | function altr_timeline_reference_schema(array $defaults):array |
| | | { |
| | | return $defaults; |
| | | } |
| | | |
| | | // |
| | | //function altr_timeline():array |
| | | //{ |
| | | // return [ |
| | | // 'singular' => 'Timeline', |
| | | // 'plural' => 'Timelines', |
| | | // 'icon' => 'hourglass', |
| | | // 'show_feed' => true, |
| | | // 'show_directory' => true, |
| | | // 'rewrite' => [ |
| | | // 'slug' => 'before-and-after/by/timeline', |
| | | // 'with_front' => false, |
| | | // ], |
| | | // 'for_content' => [ |
| | | // 'progress', |
| | | // ], |
| | | // 'seo' => [ |
| | | // 'meta' => [ |
| | | // 'title' => '{{term_name}} Between Treatments – Tattoo Removal Progress', |
| | | // 'description' => 'See how tattoos heal and fade with {{term_name}} between laser removal sessions.', |
| | | // ], |
| | | // 'schema' => [ |
| | | // 'type' => 'CollectionPage', |
| | | // 'name' => '{{term_name}} Between Treatments – Progress Photos', |
| | | // ], |
| | | // 'archive' => [ |
| | | // 'type' => 'CollectionPage', |
| | | // 'name' => 'Tattoo Removal with {{term_name}} Between Sessions', |
| | | // ], |
| | | // ], |
| | | // 'fields' => [ |
| | | // 'term_name' => [ |
| | | // 'label' => 'Name', |
| | | // 'type' => 'text', |
| | | // 'quickEdit' => true, |
| | | // ], |
| | | // 'common' => [ 'wiki' ] |
| | | // ] |
| | | // ]; |
| | | //} |