CollectionTaxonomyService.php
1 year ago
StoreTaxonomyService.php
1 year ago
TaxonomyService.php
1 year ago
TaxonomyServiceProvider.php
1 year ago
StoreTaxonomyService.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\WordPress\Taxonomies; |
| 4 | |
| 5 | /** |
| 6 | * Form post type service class. |
| 7 | */ |
| 8 | class StoreTaxonomyService { |
| 9 | /** |
| 10 | * The post type slug. |
| 11 | * |
| 12 | * @var string |
| 13 | */ |
| 14 | protected $slug = 'sc_account'; |
| 15 | |
| 16 | /** |
| 17 | * Bootstrap service. |
| 18 | * |
| 19 | * @return void |
| 20 | */ |
| 21 | public function bootstrap() { |
| 22 | add_action( 'init', [ $this, 'register' ] ); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Register the taxonomy |
| 27 | * |
| 28 | * @return void |
| 29 | */ |
| 30 | public function register() { |
| 31 | register_taxonomy( |
| 32 | $this->slug, |
| 33 | [ 'sc_product' ], |
| 34 | [ |
| 35 | 'public' => false, |
| 36 | 'hierarchical' => false, |
| 37 | 'labels' => array( |
| 38 | 'name' => __( 'Store', 'surecart' ), |
| 39 | 'singular_name' => __( 'Store', 'surecart' ), |
| 40 | ), |
| 41 | 'query_var' => false, |
| 42 | 'rewrite' => false, |
| 43 | 'show_ui' => false, |
| 44 | 'show_in_nav_menus' => false, |
| 45 | 'show_in_rest' => false, |
| 46 | 'show_admin_column' => true, |
| 47 | ] |
| 48 | ); |
| 49 | } |
| 50 | } |
| 51 |