| @@ 49-59 (lines=11) @@ | ||
| 46 | /** |
|
| 47 | * {@inheritdoc} |
|
| 48 | */ |
|
| 49 | public function taxonomyType() |
|
| 50 | { |
|
| 51 | register_taxonomy(self::TAXONOMY_TYPE_CATEGORY, self::NAME, [ |
|
| 52 | 'labels' => [ |
|
| 53 | 'name' => Translations::trans('Example category'), |
|
| 54 | 'singular_name' => Translations::trans('Example category') |
|
| 55 | ], |
|
| 56 | 'sort' => true, |
|
| 57 | 'hierarchical' => true |
|
| 58 | ]); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * {@inheritdoc} |
|
| @@ 12-22 (lines=11) @@ | ||
| 9 | { |
|
| 10 | const EXAMPLE_POST_CATEGORY = 'example_post_category'; |
|
| 11 | ||
| 12 | public function __construct() |
|
| 13 | { |
|
| 14 | new Taxonomy(self::EXAMPLE_POST_CATEGORY, PostTypes::EXAMPLE_POST_TYPE, [ |
|
| 15 | 'labels' => [ |
|
| 16 | 'name' => Translations::trans('Categories'), |
|
| 17 | 'singular_name' => Translations::trans('Category'), |
|
| 18 | ], |
|
| 19 | 'sort' => true, |
|
| 20 | 'hierarchical' => true, |
|
| 21 | ]); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||