| | |
| | | <?php |
| | | // /taxonomies/style.php |
| | | function altr_style():array |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | add_action('jvbDefineRegistrar', 'altr_style'); |
| | | add_action('jvbDefineRegistrarFields', 'altr_style_fields'); |
| | | |
| | | add_action('plugins_loaded', 'altr_style',1); |
| | | //Add fields later so we can verify taxonomies/post types exist |
| | | add_action('plugins_loaded', 'altr_style_fields', 2); |
| | | |
| | | add_filter('altr_StyleSchemaDefault', 'altr_style_schema'); |
| | | add_filter('altr_StyleMetaDefault', 'altr_style_meta'); |
| | | add_filter('altr_StyleArchiveDefault', 'altr_style_archive'); |
| | | |
| | | function altr_style(){ |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $style = Registrar::forTerm('style', 'Style', 'Styles') |
| | | ->setIcon('folder') |
| | | ->make([ |
| | | 'rewrite' => [ |
| | | 'slug' => 'before-and-after/by/style', |
| | | 'with_front' => false, |
| | | 'hierarchical' => true |
| | | ], |
| | | 'description' => 'From American Traditional to Japanese.', |
| | | 'hierarchical' => true, |
| | | 'for' => [ |
| | | 'progress', |
| | | ], |
| | | ]) |
| | | ->setAll([ |
| | | 'show_directory', |
| | | 'show_feed', |
| | | ]); |
| | | |
| | | //$directory = $style->getConfig('directory'); |
| | | |
| | | } |
| | | |
| | | function altr_style_fields():void |
| | | { |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $style = Registrar::getInstance('style'); |
| | | |
| | | $fields = $style->fields(); |
| | | $fields->addCommon('wiki'); |
| | | } |
| | | |
| | | function altr_style_schema():array |
| | | { |
| | | return [ |
| | | 'directory' => 'Styles', |
| | | 'description' => [ |
| | | 'From American Traditional to Japanese.' |
| | | ], |
| | | 'singular' => 'Style', |
| | | 'plural' => 'Styles', |
| | | 'show_directory' => true, |
| | | 'approve_new' => false, |
| | | 'icon' => 'folder', |
| | | 'favouritable' => true, |
| | | 'show_feed' => true, |
| | | 'rewrite' => [ |
| | | 'slug' => 'before-and-after/by/style', |
| | | 'with_front' => false, |
| | | 'hierarchical' => true, |
| | | ], |
| | | 'hierarchical' => true, |
| | | 'for_content' => [ |
| | | 'progress', |
| | | ], |
| | | 'seo' => [ |
| | | 'meta' => [ |
| | | 'title' => '{{term_name}} Tattoo Removal – Before & After Results', |
| | | 'description' => 'See real before and after results of {{term_name}} tattoo removal with PicoWay laser technology in Edmonton.', |
| | | ], |
| | | 'schema' => [ |
| | | 'type' => 'CollectionPage', |
| | | 'name' => '{{term_name}} Tattoo Removal Before & Afters', |
| | | 'description' => '{{term_description}}', |
| | | ], |
| | | 'archive' => [ |
| | | 'type' => 'CollectionPage', |
| | | 'name' => '{{term_name}} Tattoo Removal – Before & After Gallery', |
| | | 'description' => 'Browse laser tattoo removal progress photos for {{term_name}} tattoos.', |
| | | ], |
| | | ], |
| | | 'fields' => [ |
| | | 'term_name' => [ |
| | | 'label' => 'Name', |
| | | 'type' => 'text', |
| | | 'quickEdit' => true, |
| | | ], |
| | | 'common' => [ 'wiki', 'alternate_name', 'keywords' ] |
| | | ] |
| | | 'name' => 'How to remove {{name}} tattoos', |
| | | ]; |
| | | } |
| | | |
| | | function altr_style_meta():array |
| | | { |
| | | return[ |
| | | 'name' => 'How to remove {{name}} tattoos', |
| | | 'description' => '{{description}}', |
| | | ]; |
| | | } |
| | | |
| | | function altr_style_archive(array $defaults):array |
| | | { |
| | | return array_merge($defaults, [ |
| | | 'name' => 'How to remove {{name}} tattoos', |
| | | 'description'=> 'Browse laser tattoo removal progress photos for {{name}} tattoos.', |
| | | ]); |
| | | } |
| | | |
| | | function altr_style_reference_schema(array $defaults):array |
| | | { |
| | | return $defaults; |
| | | } |
| | | // |
| | | //function altr_style():array |
| | | //{ |
| | | // return [ |
| | | // 'directory' => 'Styles', |
| | | // 'description' => [ |
| | | // 'From American Traditional to Japanese.' |
| | | // ], |
| | | // 'singular' => 'Style', |
| | | // 'plural' => 'Styles', |
| | | // 'show_directory' => true, |
| | | // 'approve_new' => false, |
| | | // 'icon' => 'folder', |
| | | // 'favouritable' => true, |
| | | // 'show_feed' => true, |
| | | // 'rewrite' => [ |
| | | // 'slug' => 'before-and-after/by/style', |
| | | // 'with_front' => false, |
| | | // 'hierarchical' => true, |
| | | // ], |
| | | // 'hierarchical' => true, |
| | | // 'for_content' => [ |
| | | // 'progress', |
| | | // ], |
| | | // 'seo' => [ |
| | | // 'meta' => [ |
| | | // 'title' => '{{term_name}} Tattoo Removal – Before & After Results', |
| | | // 'description' => 'See real before and after results of {{term_name}} tattoo removal with PicoWay laser technology in Edmonton.', |
| | | // ], |
| | | // 'schema' => [ |
| | | // 'type' => 'CollectionPage', |
| | | // 'name' => '{{term_name}} Tattoo Removal Before & Afters', |
| | | // 'description' => '{{term_description}}', |
| | | // ], |
| | | // 'archive' => [ |
| | | // 'type' => 'CollectionPage', |
| | | // 'name' => '{{term_name}} Tattoo Removal – Before & After Gallery', |
| | | // 'description' => 'Browse laser tattoo removal progress photos for {{term_name}} tattoos.', |
| | | // ], |
| | | // ], |
| | | // 'fields' => [ |
| | | // 'term_name' => [ |
| | | // 'label' => 'Name', |
| | | // 'type' => 'text', |
| | | // 'quickEdit' => true, |
| | | // ], |
| | | // 'common' => [ 'wiki', 'alternate_name', 'keywords' ] |
| | | // ] |
| | | // ]; |
| | | //} |