| @@ 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} |
|
| @@ 23-33 (lines=11) @@ | ||
| 20 | { |
|
| 21 | const EXAMPLE_POST_CATEGORY = 'example_post_category'; |
|
| 22 | ||
| 23 | public function __construct() |
|
| 24 | { |
|
| 25 | new Taxonomy(self::EXAMPLE_POST_CATEGORY, PostTypes::EXAMPLE_POST_TYPE, [ |
|
| 26 | 'labels' => [ |
|
| 27 | 'name' => Translations::trans('Categories'), |
|
| 28 | 'singular_name' => Translations::trans('Category'), |
|
| 29 | ], |
|
| 30 | 'sort' => true, |
|
| 31 | 'hierarchical' => true, |
|
| 32 | ]); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||