1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
<?php
namespace hji\geofarms\models;
use \hji\geofarms\GeoFarms;
class Taxonomy
{
public $taxonomy_name = 'geo_farm_area_tags';
public function create_taxonomy()
{
$labels = array(
'name' => _x('Area Tags', 'taxonomy general name', 'hji_geo_farms'),
'singular_name' => _x('Area Tag', 'taxonomy singular name', 'hji_geo_farms'),
'all_items' => __('All Tags', 'hji_geo_farms'),
'edit_item' => __('Edit Tag', 'hji_geo_farms'),
'view_item' => __('View Tag', 'hji_geo_farms'),
'add_new_item' => __('Add New Tag', 'hji_geo_farms'),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
);
register_taxonomy( $this->taxonomy_name, GeoFarms::$post_type, $args );
register_taxonomy_for_object_type( $this->taxonomy_name, GeoFarms::$post_type );
}
}