<?php
|
// /taxonomies/offer_for.php
|
|
use JVBase\registrar\Registrar;
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
add_action('jvbDefineRegistrar', 'aei_offer_for');
|
add_action('jvbDefineRegistrarFields', 'aei_offer_for_fields');
|
|
add_action('plugins_loaded', 'aei_offer_for',3);
|
//Add fields later so we can verify taxonomies/post types exist
|
add_action('plugins_loaded', 'aei_offer_for_fields', 4);
|
|
add_filter('aei_Offer_forSchemaDefault', 'aei_offer_for_schema');
|
add_filter('aei_Offer_forMetaDefault', 'aei_offer_for_meta');
|
add_filter('aei_Offer_forArchiveDefault', 'aei_offer_for_archive');
|
|
function aei_offer_for(){
|
if (!class_exists('JVBase\registrar\Registrar')) {
|
return;
|
}
|
$offer_for = Registrar::forTerm('offer_for', 'Offer For', 'Offer For')
|
->setIcon('target')
|
->make([
|
'rewrite' => [
|
'slug' => 'offers/for',
|
'with_front' => false,
|
'hierarchical' => true,
|
],
|
'for' => [
|
'artist',
|
'event',
|
],
|
'hierarchical' => true,
|
])
|
->setAll([
|
'show_feed',
|
'show_directory',
|
'track_changes',
|
]);
|
|
//$directory = $offer_for->getConfig('directory');
|
|
}
|
|
function aei_offer_for_fields():void
|
{
|
if (!class_exists('JVBase\registrar\Registrar')) {
|
return;
|
}
|
$offer_for = Registrar::getInstance('offer_for');
|
|
$fields = $offer_for->fields();
|
$fields->addCommon('wiki');
|
$fields->addCommon('alternate_name');
|
$fields->addCommon('keywords');
|
}
|
|
function aei_offer_for_schema():array
|
{
|
return [
|
// 'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\CreativeWork',
|
'name' => '{{name}} | Canadian Offer For',
|
'about' => [
|
'type' => 'JVBase\managers\SEO\render\Thing\Place\AdministrativeArea\Offer For',
|
'name' => '{{name}}',
|
],
|
'description' => '{{description}}',
|
];
|
}
|
|
function aei_offer_for_meta():array
|
{
|
return[
|
'name' => 'Best Tattoos in {{name}}',
|
'description' => 'Tattoos, piercings, tattoo artists, and tattoo offer_fors in {{name}}.'
|
];
|
}
|
|
function aei_offer_for_archive(array $defaults):array
|
{
|
return array_merge($defaults, [
|
'name' => '{{name}}\'s Best Tattoo Artists',
|
]);
|
}
|
|
function aei_offer_for_reference_schema(array $defaults):array
|
{
|
return $defaults;
|
}
|