<?php
|
// /users/client.php
|
|
use JVBase\registrar\Registrar;
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
add_action('jvbDefineRegistrar', 'altr_client');
|
add_action('jvbDefineRegistrarFields', 'altr_client_fields');
|
add_action('plugins_loaded', 'altr_client',1);
|
//Add fields later so we can verify taxonomies/post types exist
|
add_action('plugins_loaded', 'altr_client_fields', 2);
|
|
add_filter('altr_ClientSchemaDefault', 'altr_client_schema');
|
add_filter('altr_ClientMetaDefault', 'altr_client_meta');
|
add_filter('altr_ClientArchiveDefault', 'altr_client_archive');
|
|
function altr_client(){
|
if (!class_exists('JVBase\registrar\Registrar')) {
|
return;
|
}
|
$client = Registrar::forUser('client', 'Client', 'Clients')
|
->setIcon('user')
|
->make([
|
'can_create' => ['support']
|
])
|
->setAll([
|
'has_dashboard',
|
'show_feed',
|
'can_register',
|
]);
|
|
//$directory = $client->getConfig('directory');
|
|
}
|
|
function altr_client_fields():void
|
{
|
if (!class_exists('JVBase\registrar\Registrar')) {
|
return;
|
}
|
$client = Registrar::getInstance('client');
|
|
$fields = $client->fields();
|
$fields->addCommon('wiki');
|
}
|
|
function altr_client_schema():array
|
{
|
return [
|
'name' => '{{name}} Laser Tattoo Removal Before & Afters',
|
];
|
}
|
|
function altr_client_meta():array
|
{
|
return[
|
'name' => '{{name}} – Before & After Laser Tattoo Removal',
|
'description' => 'Before and after results for clients seeking {{term_name}}. See how PicoWay laser technology delivers results in Edmonton.',
|
];
|
}
|
|
function altr_client_archive(array $defaults):array
|
{
|
return array_merge($defaults, [
|
'name' => '{{name}} – Laser Tattoo Removal Results',
|
]);
|
}
|
|
function altr_client_reference_schema(array $defaults):array
|
{
|
return $defaults;
|
}
|
|
|
//
|
//function altr_user_client():array
|
//{
|
// return [
|
// 'label' => 'Client',
|
// 'singular' => 'Singular',
|
// 'plural' => 'Plural',
|
// 'has_dashboard' => true,
|
// 'can_create' => ['support'],
|
// 'can_register' => true,
|
// 'keep_stats' => false,
|
// 'icon' => 'user',
|
// 'register' => [
|
// 'text' => 'Refer your friends. Get rewarded.',
|
// 'title' => 'Create Your Account',
|
// 'description' => [
|
// 'Get your unique share code',
|
// 'Share it with your friends',
|
// 'Get notified when you get your credit'
|
// ],
|
// 'submit' => 'Create Your Account',
|
// ],
|
// ];
|
//}
|