| 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 CodePostType |
| 10 |
* @package FL\Assistant\PostTypes |
| 11 |
*/ |
| 12 |
class CodePostType 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_code', [ |
| 26 |
'label' => __( 'Code', 'fl-assistant' ), |
| 27 |
'public' => false, |
| 28 |
] |
| 29 |
); |
| 30 |
|
| 31 |
$this->labels->save_defaults(); |
| 32 |
} |
| 33 |
} |
| 34 |
|