| 1 |
<?php |
| 2 |
|
| 3 |
namespace FL\Assistant\PostTypes; |
| 4 |
|
| 5 |
use FL\Assistant\System\Contracts\PostTypeAbstract; |
| 6 |
use FL\Assistant\Data\Repository\LabelsRepository; |
| 7 |
|
| 8 |
/** |
| 9 |
* Class NotationsPostType |
| 10 |
* @package FL\Assistant\PostTypes |
| 11 |
*/ |
| 12 |
class NotationsPostType extends PostTypeAbstract { |
| 13 |
|
| 14 |
protected $labels; |
| 15 |
|
| 16 |
public function __construct( LabelsRepository $labels ) { |
| 17 |
$this->labels = $labels; |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* @return void |
| 22 |
*/ |
| 23 |
public function register() { |
| 24 |
register_post_type( |
| 25 |
'fl_asst_notation', [ |
| 26 |
'label' => __( 'Assistant Notation', 'fl-assistant' ), |
| 27 |
'public' => false, |
| 28 |
] |
| 29 |
); |
| 30 |
|
| 31 |
register_taxonomy( |
| 32 |
'fl_asst_label', [ 'fl_asst_notation' ], [ |
| 33 |
'label' => _x( 'Label', 'Custom taxonomy label.', 'fl-assistant' ), |
| 34 |
'hierarchical' => false, |
| 35 |
'public' => false, |
| 36 |
'show_admin_column' => false, |
| 37 |
] |
| 38 |
); |
| 39 |
|
| 40 |
$this->labels->save_defaults(); |
| 41 |
} |
| 42 |
} |
| 43 |
|