| | |
| | | <?php |
| | | // /taxonomies/progress.php |
| | | function ajv_progress():array |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | |
| | | add_action('plugins_loaded', 'ajv_progress',1); |
| | | //Add fields later so we can verify taxonomies/post types exist |
| | | add_action('plugins_loaded', 'ajv_progress_fields', 2); |
| | | |
| | | add_filter('ajv_ProgressSchemaDefault', 'ajv_progress_schema'); |
| | | add_filter('ajv_ProgressMetaDefault', 'ajv_progress_meta'); |
| | | add_filter('ajv_ProgressArchiveDefault', 'ajv_progress_archive'); |
| | | |
| | | function ajv_progress(){ |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $progress = Registrar::forTerm('progress', 'Progress', 'Progresss') |
| | | ->setIcon('scribble') |
| | | ->make([ |
| | | 'rewrite' => [ |
| | | 'slug' => 'in/progress', |
| | | 'with_front' => false, |
| | | ], |
| | | 'for' => [ |
| | | 'art', |
| | | 'design', |
| | | 'development', |
| | | 'strategy', |
| | | 'writing' |
| | | ], |
| | | 'hierarchical' => true, |
| | | ]) |
| | | ->setAll([ |
| | | 'show_feed', |
| | | 'show_directory', |
| | | ]); |
| | | } |
| | | |
| | | function ajv_progress_fields():void |
| | | { |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $progress = Registrar::getInstance('progress'); |
| | | |
| | | //$directory = $progress->getConfig('directory'); |
| | | //$breadcrumbs = $progress->config('breadcrumbs'); |
| | | //$breadcrumbs->setCrumb('project'); |
| | | |
| | | $fields = $progress->fields(); |
| | | $fields->addCommon('wiki'); |
| | | } |
| | | |
| | | //function ajv_progress():array |
| | | //{ |
| | | // return [ |
| | | // 'singular' => 'Progress', |
| | | // 'plural' => 'Progress', |
| | | // 'icon' => 'circle-notch', |
| | | // 'show_feed' => true, |
| | | // 'show_directory' => true, |
| | | // 'approve_new' => false, |
| | | // 'rewrite' => [ |
| | | // 'slug' => 'progress', |
| | | // 'with_front' => false, |
| | | // 'hierarchical' => true, |
| | | // ], |
| | | // 'hierarchical' => true, |
| | | // 'for_content' => [ |
| | | // 'art', |
| | | // 'progress', |
| | | // 'development', |
| | | // 'strategy', |
| | | // 'writing', |
| | | // ], |
| | | // 'seo' => [ |
| | | // 'meta' => [ |
| | | // 'title' => '{{name}} Projects | JakeVan', |
| | | // ], |
| | | // 'archive' => [ |
| | | // 'type' => 'CollectionPage', |
| | | // 'name' => '{{name}} Projects', |
| | | // ], |
| | | // ], |
| | | // 'fields' => [ |
| | | // 'term_name' => [ |
| | | // 'label' => 'Name', |
| | | // 'type' => 'text', |
| | | // 'quickEdit' => true, |
| | | // ], |
| | | // 'common' => [ 'wiki' ] |
| | | // ] |
| | | // ]; |
| | | //} |
| | | |
| | | |
| | | function ajv_progress_schema():array |
| | | { |
| | | return [ |
| | | 'singular' => 'Progress', |
| | | 'plural' => 'Progress', |
| | | 'icon' => 'circle-notch', |
| | | 'show_feed' => true, |
| | | 'show_directory' => true, |
| | | 'approve_new' => false, |
| | | 'rewrite' => [ |
| | | 'slug' => 'progress', |
| | | 'with_front' => false, |
| | | 'hierarchical' => true, |
| | | ], |
| | | 'hierarchical' => true, |
| | | 'for_content' => [ |
| | | 'art', |
| | | 'design', |
| | | 'development', |
| | | 'strategy', |
| | | 'writing', |
| | | ], |
| | | 'seo' => [ |
| | | 'meta' => [ |
| | | 'title' => '{{term_name}} Projects | JakeVan', |
| | | ], |
| | | 'archive' => [ |
| | | 'type' => 'CollectionPage', |
| | | 'name' => '{{term_name}} Projects', |
| | | ], |
| | | ], |
| | | 'fields' => [ |
| | | 'term_name' => [ |
| | | 'label' => 'Name', |
| | | 'type' => 'text', |
| | | 'quickEdit' => true, |
| | | ], |
| | | 'common' => [ 'wiki' ] |
| | | ] |
| | | 'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\CreativeWork', |
| | | 'name' => '{{name}} Projects', |
| | | 'description' => '{{description}}', |
| | | ]; |
| | | } |
| | | |
| | | function ajv_progress_meta():array |
| | | { |
| | | return[ |
| | | 'name' => '{{name}} Projects', |
| | | ]; |
| | | } |
| | | |
| | | function ajv_progress_archive(array $defaults):array |
| | | { |
| | | return array_merge($defaults, [ |
| | | 'name' => '{{name}} Projects', |
| | | ]); |
| | | } |
| | | |
| | | function ajv_progress_reference_schema(array $defaults):array |
| | | { |
| | | return $defaults; |
| | | } |