| 1 |
<?php |
| 2 |
|
| 3 |
namespace Booktics\Abstracts; |
| 4 |
|
| 5 |
abstract class Taxonomy { |
| 6 |
|
| 7 |
/** |
| 8 |
* Register the taxonomy using WordPress register_taxonomy function |
| 9 |
* |
| 10 |
* @return void |
| 11 |
*/ |
| 12 |
public function register() { |
| 13 |
register_taxonomy( $this->get_name(), $this->get_obj_type(), $this->get_args() ); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Get taxonomy name |
| 18 |
* |
| 19 |
* @return string |
| 20 |
*/ |
| 21 |
abstract public function get_name(); |
| 22 |
|
| 23 |
/** |
| 24 |
* Get taxonomy object type |
| 25 |
* |
| 26 |
* @return string|array |
| 27 |
*/ |
| 28 |
abstract public function get_obj_type(); |
| 29 |
|
| 30 |
/** |
| 31 |
* Get taxonomy arguments |
| 32 |
* |
| 33 |
* @return array |
| 34 |
*/ |
| 35 |
abstract public function get_args(); |
| 36 |
} |
| 37 |
|