| | |
| | | <?php |
| | | // /taxonomies/city.php |
| | | function ajv_city():array |
| | | |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | |
| | | add_action('jvbDefineRegistrar', 'ami_city'); |
| | | add_action('jvbDefineRegistrarFields', 'ami_city_fields'); |
| | | |
| | | add_action('plugins_loaded', 'ami_city',1); |
| | | //Add fields later so we can verify taxonomies/post types exist |
| | | add_action('plugins_loaded', 'ami_city_fields', 2); |
| | | |
| | | add_filter('ami_CitySchemaDefault', 'ami_city_schema'); |
| | | add_filter('ami_CityMetaDefault', 'ami_city_meta'); |
| | | add_filter('ami_CityArchiveDefault', 'ami_city_archive'); |
| | | |
| | | function ami_city(){ |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $city = Registrar::forTerm('city', 'City', 'Cities') |
| | | ->setIcon('city') |
| | | ->make([ |
| | | 'rewrite' => [ |
| | | 'slug' => 'in/city', |
| | | 'with_front' => false, |
| | | 'hierarchical' => true, |
| | | ], |
| | | 'for' => [ |
| | | 'product', |
| | | 'service', |
| | | ], |
| | | ]) |
| | | ->setAll([ |
| | | 'show_directory', |
| | | 'show_feed', |
| | | ]); |
| | | |
| | | //$directory = $city->getConfig('directory'); |
| | | |
| | | } |
| | | |
| | | function ami_city_fields():void |
| | | { |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $city = Registrar::getInstance('city'); |
| | | // $breadcrumbs = $city->config('breadcrumbs'); |
| | | |
| | | |
| | | $fields = $city->fields(); |
| | | $fields->addCommon('wiki'); |
| | | } |
| | | |
| | | function ami_city_schema():array |
| | | { |
| | | return [ |
| | | 'singular' => 'City', |
| | | 'plural' => 'Cities', |
| | | 'icon' => 'city', |
| | | 'description' => [ |
| | | 'From Edmonton, yes - but also throughout Alberta.' |
| | | ], |
| | | 'show_feed' => true, |
| | | 'show_directory' => true, |
| | | 'approve_new' => false, |
| | | 'rewrite' => [ |
| | | 'slug' => 'in', |
| | | 'with_front' => false, |
| | | 'hierarchical' => true, |
| | | ], |
| | | 'hierarchical' => true, |
| | | 'for_content' => [ |
| | | 'art', |
| | | 'design', |
| | | 'development', |
| | | 'strategy', |
| | | 'writing', |
| | | ], |
| | | 'fields' => [ |
| | | 'term_name' => [ |
| | | 'label' => 'Name', |
| | | 'type' => 'text', |
| | | 'quickEdit' => true, |
| | | ], |
| | | 'common' => [ 'wiki' ] |
| | | ] |
| | | 'type' => 'JVBase\managers\SEO\render\Thing\City\City', |
| | | 'name' => '{{post_title}}', |
| | | ]; |
| | | } |
| | | |
| | | function ami_city_meta():array |
| | | { |
| | | return[ |
| | | 'name' => '{{post_title}}', |
| | | ]; |
| | | } |
| | | |
| | | function ami_city_archive(array $defaults):array |
| | | { |
| | | return array_merge($defaults, [ |
| | | ]); |
| | | } |
| | | |
| | | function ami_city_reference_schema(array $defaults):array |
| | | { |
| | | return $defaults; |
| | | } |
| | | |
| | | // |
| | | //function ami_city():array |
| | | //{ |
| | | // return [ |
| | | // 'singular' => 'City', |
| | | // 'plural' => 'Cities', |
| | | // 'icon' => 'city', |
| | | // 'description' => [ |
| | | // 'From Kamloops, yes - but also throughout Alberta and BC.' |
| | | // ], |
| | | // 'show_feed' => true, |
| | | // 'show_directory' => true, |
| | | // 'rewrite' => [ |
| | | // 'slug' => 'in', |
| | | // 'with_front' => false, |
| | | // 'hierarchical' => true, |
| | | // ], |
| | | // 'hierarchical' => true, |
| | | // 'for_content' => [ |
| | | // 'art', |
| | | // 'design', |
| | | // 'development', |
| | | // 'strategy', |
| | | // 'writing', |
| | | // ], |
| | | // 'fields' => [ |
| | | // 'term_name' => [ |
| | | // 'label' => 'Name', |
| | | // 'type' => 'text', |
| | | // 'quickEdit' => true, |
| | | // ], |
| | | // 'common' => [ 'wiki' ] |
| | | // ] |
| | | // ]; |
| | | //} |