| 1 |
<?php |
| 2 |
|
| 3 |
namespace Booktics\Base\Services; |
| 4 |
|
| 5 |
/** |
| 6 |
* Handles registration of all custom post statuses for Booktics. |
| 7 |
*/ |
| 8 |
class Post_Status_Service { |
| 9 |
|
| 10 |
public $post_statuses = array( |
| 11 |
'active', |
| 12 |
'deactive', |
| 13 |
'pending', |
| 14 |
'canceled', |
| 15 |
'approved', |
| 16 |
'completed', |
| 17 |
'not_show', |
| 18 |
); |
| 19 |
|
| 20 |
/** |
| 21 |
* Register all custom post statuses. |
| 22 |
*/ |
| 23 |
public function register() { |
| 24 |
foreach ( $this->post_statuses as $post_status ) { |
| 25 |
$label = ucwords( str_replace( '_', ' ', $post_status ) ); |
| 26 |
register_post_status( |
| 27 |
$post_status, array( |
| 28 |
'label' => __( $label, 'booktics' ), |
| 29 |
'public' => true, |
| 30 |
'publicly_queryable' => true, |
| 31 |
'exclude_from_search' => false, |
| 32 |
'show_in_admin_all_list' => true, |
| 33 |
'show_in_admin_status_list' => true, |
| 34 |
'label_count' => _n_noop( $label . ' <span class="count">(%s)</span>', $label . ' <span class="count">(%s)</span>', 'booktics' ), |
| 35 |
) |
| 36 |
); |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
|