<?php
|
// /taxonomies/shop.php
|
|
use JVBase\registrar\Registrar;
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
add_action('jvbDefineRegistrar', 'aei_shop');
|
add_action('jvbDefineRegistrarFields', 'aei_shop_fields');
|
|
add_action('plugins_loaded', 'aei_shop',3);
|
//Add fields later so we can verify taxonomies/post types exist
|
add_action('plugins_loaded', 'aei_shop_fields', 4);
|
|
add_filter('aei_ShopSchemaDefault', 'aei_shop_schema');
|
add_filter('aei_ShopMetaDefault', 'aei_shop_meta');
|
add_filter('aei_ShopArchiveDefault', 'aei_shop_archive');
|
|
function aei_shop(){
|
if (!class_exists('JVBase\registrar\Registrar')) {
|
return;
|
}
|
$shop = Registrar::forTerm('shop', 'Shop', 'Shops')
|
->setIcon('shop')
|
->make([
|
'rewrite' => [
|
'slug' => 'tattoo-shops',
|
'with_front' => false,
|
'hierarchical' => true,
|
],
|
'for' => [
|
'artist',
|
'event',
|
],
|
'hierarchical' => true,
|
])
|
->setAll([
|
'show_feed',
|
'show_directory',
|
'track_changes',
|
'favouritable',
|
'karma',
|
'invitable',
|
'is_content',
|
'is_ownable',
|
'verify_entry',
|
'associate_user_content',
|
]);
|
|
//$directory = $shop->getConfig('directory');
|
|
}
|
|
function aei_shop_fields():void
|
{
|
if (!class_exists('JVBase\registrar\Registrar')) {
|
return;
|
}
|
$shop = Registrar::getInstance('shop');
|
|
$fields = $shop->fields();
|
$fields->addCommon('wiki');
|
$fields->addCommon('alternate_name');
|
$fields->addCommon('keywords');
|
}
|
|
function aei_shop_schema():array
|
{
|
return [
|
// 'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\CreativeWork',
|
'name' => '{{name}} | Canadian Shop',
|
'about' => [
|
'type' => 'JVBase\managers\SEO\render\Thing\Place\AdministrativeArea\Shop',
|
'name' => '{{name}}',
|
],
|
'description' => '{{description}}',
|
];
|
}
|
|
function aei_shop_meta():array
|
{
|
return[
|
'name' => 'Best Tattoos in {{name}}',
|
'description' => 'Tattoos, piercings, tattoo artists, and tattoo shops in {{name}}.'
|
];
|
}
|
|
function aei_shop_archive(array $defaults):array
|
{
|
return array_merge($defaults, [
|
'name' => '{{name}}\'s Best Tattoo Artists',
|
]);
|
}
|
|
function aei_shop_reference_schema(array $defaults):array
|
{
|
return $defaults;
|
}
|