| | |
| | | <?php |
| | | // /taxonomies/flags.php |
| | | function atat_flags():array |
| | | { |
| | | return [ |
| | | 'singular' => 'Flag', |
| | | 'plural' => 'Flags', |
| | | 'icon' => 'warning-diamond', |
| | | // /taxonomies/flag.php |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | | } |
| | | |
| | | add_action('jvbDefineRegistrar', 'atat_flag'); |
| | | add_action('jvbDefineRegistrarFields', 'atat_flag_fields'); |
| | | |
| | | add_action('plugins_loaded', 'atat_flag',3); |
| | | //Add fields later so we can verify taxonomies/post types exist |
| | | add_action('plugins_loaded', 'atat_flag_fields', 4); |
| | | |
| | | add_filter('atat_AgeSchemaDefault', 'atat_flag_schema'); |
| | | add_filter('atat_AgeMetaDefault', 'atat_flag_meta'); |
| | | add_filter('atat_AgeArchiveDefault', 'atat_flag_archive'); |
| | | |
| | | function atat_flag(){ |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $flag = Registrar::forTerm('flag', 'Flag', 'Flags') |
| | | ->setIcon('flag') |
| | | ->make([ |
| | | 'rewrite' => [ |
| | | 'slug' => 'flagged', |
| | | 'with_front' => false, |
| | | 'hierarchical' => true, |
| | | ], |
| | | 'hierarchical' => true, |
| | | 'for_content' => [ |
| | | 'for' => [ |
| | | 'soap', |
| | | ], |
| | | 'fields' => [ |
| | | 'term_name' => [ |
| | | 'label' => 'Name', |
| | | 'type' => 'text', |
| | | 'quickEdit' => true, |
| | | ], |
| | | 'common' => [ 'wiki', 'alternate_name', 'keywords' ] |
| | | ] |
| | | 'hierarchical' => true, |
| | | ]) |
| | | ->setAll([ |
| | | 'show_directory', |
| | | 'show_feed', |
| | | ]); |
| | | |
| | | //$directory = $flag->getConfig('directory'); |
| | | |
| | | } |
| | | |
| | | function atat_flag_fields():void |
| | | { |
| | | if (!class_exists('JVBase\registrar\Registrar')) { |
| | | return; |
| | | } |
| | | $flag = Registrar::getInstance('flag'); |
| | | |
| | | $fields = $flag->fields(); |
| | | $fields->addCommon('wiki'); |
| | | $fields->addCommon('alternate_name'); |
| | | $fields->addCommon('keywords'); |
| | | } |
| | | |
| | | function atat_flag_schema():array |
| | | { |
| | | return [ |
| | | 'name' => 'How to Remove a {{name}} Old Tattoo - Before & After', |
| | | ]; |
| | | } |
| | | |
| | | function atat_flag_meta():array |
| | | { |
| | | return[ |
| | | 'name' => 'How to Remove a {{name}} Old Tattoo - Before & After', |
| | | 'description' => 'See laser removal results on tattoos that are {{name}} old. Older ink often responds differently to treatment.' |
| | | ]; |
| | | } |
| | | |
| | | function atat_flag_archive(array $defaults):array |
| | | { |
| | | return array_merge($defaults, [ |
| | | 'name' => 'Removing {{term_name}} Old Tattoos – Before & After', |
| | | ]); |
| | | } |
| | | |
| | | function atat_flag_reference_schema(array $defaults):array |
| | | { |
| | | return $defaults; |
| | | } |
| | | |
| | | // |
| | | //function atat_flags():array |
| | | //{ |
| | | // return [ |
| | | // 'singular' => 'Flag', |
| | | // 'plural' => 'Flags', |
| | | // 'icon' => 'warning-diamond', |
| | | // 'rewrite' => [ |
| | | // 'slug' => 'flagged', |
| | | // 'with_front' => false, |
| | | // 'hierarchical' => true, |
| | | // ], |
| | | // 'hierarchical' => true, |
| | | // 'for_content' => [ |
| | | // 'soap', |
| | | // ], |
| | | // 'fields' => [ |
| | | // 'term_name' => [ |
| | | // 'label' => 'Name', |
| | | // 'type' => 'text', |
| | | // 'quickEdit' => true, |
| | | // ], |
| | | // 'common' => [ 'wiki', 'alternate_name', 'keywords' ] |
| | | // ] |
| | | // ]; |
| | | //} |