| | |
| | | <?php |
| | | // /taxonomies/target.php |
| | | function altr_person():array |
| | | { |
| | | return [ |
| | | 'singular' => 'Person', |
| | | 'plural' => 'People', |
| | | 'icon' => 'user', |
| | | 'show_feed' => false, |
| | | 'public' => false, |
| | | 'show_ui' => true, |
| | | 'hierarchical' => false, |
| | | 'for_content' => [ |
| | | 'progress', |
| | | ], |
| | | 'fields' => [ |
| | | 'term_name' => [ |
| | | 'label' => 'Name', |
| | | 'type' => 'text', |
| | | 'quickEdit' => true, |
| | | ] |
| | | ] |
| | | ]; |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | |
| | | add_action('jvbDefineRegistrar', 'altr_person'); |
| | | add_action('jvbDefineRegistrarFields', 'altr_person_fields'); |
| | | |
| | | add_action('plugins_loaded', 'altr_person',1); |
| | | //Add fields later so we can verify taxonomies/post types exist |
| | | add_action('plugins_loaded', 'altr_person_fields', 2); |
| | | |
| | | function altr_person(){ |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $person = Registrar::forTerm('person', 'Person', 'People') |
| | | ->setIcon('user') |
| | | ->make([ |
| | | 'public' => false, |
| | | 'show_ui' => true, |
| | | 'for' => [ |
| | | 'progress', |
| | | ], |
| | | 'show_admin_column' => true |
| | | ]); |
| | | |
| | | //$directory = $person->getConfig('directory'); |
| | | |
| | | } |
| | | |
| | | function altr_person_fields():void |
| | | { |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $person = Registrar::getInstance('person'); |
| | | |
| | | $fields = $person->fields(); |
| | | } |
| | | |
| | | // |
| | | //function altr_person():array |
| | | //{ |
| | | // return [ |
| | | // 'singular' => 'Person', |
| | | // 'plural' => 'People', |
| | | // 'icon' => 'user', |
| | | // 'show_feed' => false, |
| | | // 'public' => false, |
| | | // 'show_ui' => true, |
| | | // 'hierarchical' => false, |
| | | // 'for_content' => [ |
| | | // 'progress', |
| | | // ], |
| | | // 'fields' => [ |
| | | // 'term_name' => [ |
| | | // 'label' => 'Name', |
| | | // 'type' => 'text', |
| | | // 'quickEdit' => true, |
| | | // ] |
| | | // ] |
| | | // ]; |
| | | //} |