WC_GZD_Post_Types

Registers delivery time taxonomy.

Defined (1)

The class is defined in the following location(s).

/includes/class-wc-gzd-post-types.php  
  1. class WC_GZD_Post_Types { 
  2.  
  3. /** 
  4. * Hook in methods 
  5. */ 
  6. public static function init() { 
  7. add_action( 'init', array( __CLASS__, 'register_taxonomies' ), 11 ); 
  8.  
  9. /** 
  10. * Register Delivery Time Taxonomy 
  11. */ 
  12. public static function register_taxonomies() { 
  13. // Delivery time 
  14. register_taxonomy( 'product_delivery_time',  
  15. apply_filters( 'woocommerce_germanized_taxonomy_objects_product_delivery_time', array( 'product' ) ),  
  16. apply_filters( 'woocommerce_germanized_taxonomy_args_product_delivery_time', array( 
  17. 'hierarchical' => false,  
  18. 'update_count_callback' => '_wc_term_recount',  
  19. 'label' => __( 'Product Delivery Times', 'woocommerce-germanized' ),  
  20. 'labels' => array( 
  21. 'name' => __( 'Product Delivery Times', 'woocommerce-germanized' ),  
  22. 'singular_name' => __( 'Product Delivery Time', 'woocommerce-germanized' ),  
  23. 'menu_name' => _x( 'Delivery Time', 'Admin menu name', 'woocommerce-germanized' ),  
  24. 'search_items' => __( 'Search Delivery Times', 'woocommerce-germanized' ),  
  25. 'all_items' => __( 'All Product Delivery Times', 'woocommerce-germanized' ),  
  26. 'edit_item' => __( 'Edit Product Delivery Time', 'woocommerce-germanized' ),  
  27. 'update_item' => __( 'Update Product Delivery Time', 'woocommerce-germanized' ),  
  28. 'add_new_item' => __( 'Add New Product Delivery Time', 'woocommerce-germanized' ),  
  29. 'new_item_name' => __( 'New Product Delivery Time Name', 'woocommerce-germanized' ) 
  30. ),  
  31. 'show_ui' => true,  
  32. 'query_var' => true,  
  33. 'public' => false,  
  34. 'capabilities' => array( 
  35. 'manage_terms' => 'manage_product_terms',  
  36. 'edit_terms' => 'edit_product_terms',  
  37. 'delete_terms' => 'delete_product_terms',  
  38. 'assign_terms' => 'assign_product_terms',  
  39. ),  
  40. 'rewrite' => false,  
  41. ) ) 
  42. ); 
  43. // Units 
  44. register_taxonomy( 'product_unit',  
  45. apply_filters( 'woocommerce_germanized_taxonomy_objects_product_unit', array( 'product' ) ),  
  46. apply_filters( 'woocommerce_germanized_taxonomy_args_product_unit', array( 
  47. 'hierarchical' => false,  
  48. 'update_count_callback' => '_wc_term_recount',  
  49. 'label' => __( 'Units', 'woocommerce-germanized' ),  
  50. 'labels' => array( 
  51. 'name' => __( 'Units', 'woocommerce-germanized' ),  
  52. 'singular_name' => __( 'Unit', 'woocommerce-germanized' ),  
  53. 'menu_name' => _x( 'Units', 'Admin menu name', 'woocommerce-germanized' ),  
  54. 'search_items' => __( 'Search Units', 'woocommerce-germanized' ),  
  55. 'all_items' => __( 'All Units', 'woocommerce-germanized' ),  
  56. 'edit_item' => __( 'Edit Unit', 'woocommerce-germanized' ),  
  57. 'update_item' => __( 'Update Unit', 'woocommerce-germanized' ),  
  58. 'add_new_item' => __( 'Add New Unit', 'woocommerce-germanized' ),  
  59. 'new_item_name' => __( 'New Unit Name', 'woocommerce-germanized' ) 
  60. ),  
  61. 'show_ui' => true,  
  62. 'query_var' => true,  
  63. 'public' => false,  
  64. 'capabilities' => array( 
  65. 'manage_terms' => 'manage_product_terms',  
  66. 'edit_terms' => 'edit_product_terms',  
  67. 'delete_terms' => 'delete_product_terms',  
  68. 'assign_terms' => 'assign_product_terms',  
  69. ),  
  70. 'rewrite' => false,  
  71. ) ) 
  72. ); 
  73. // Price labels 
  74. register_taxonomy( 'product_price_label',  
  75. apply_filters( 'woocommerce_germanized_taxonomy_objects_product_price_label', array( 'product' ) ),  
  76. apply_filters( 'woocommerce_germanized_taxonomy_args_product_price_label', array( 
  77. 'hierarchical' => false,  
  78. 'update_count_callback' => '_wc_term_recount',  
  79. 'label' => __( 'Price Labels', 'woocommerce-germanized' ),  
  80. 'labels' => array( 
  81. 'name' => __( 'Price Labels', 'woocommerce-germanized' ),  
  82. 'singular_name' => __( 'Price Label', 'woocommerce-germanized' ),  
  83. 'menu_name' => _x( 'Price Labels', 'Admin menu name', 'woocommerce-germanized' ),  
  84. 'search_items' => __( 'Search Price Labels', 'woocommerce-germanized' ),  
  85. 'all_items' => __( 'All Price Labels', 'woocommerce-germanized' ),  
  86. 'edit_item' => __( 'Edit Price Label', 'woocommerce-germanized' ),  
  87. 'update_item' => __( 'Update Price Label', 'woocommerce-germanized' ),  
  88. 'add_new_item' => __( 'Add New Price Label', 'woocommerce-germanized' ),  
  89. 'new_item_name' => __( 'New Price Label Name', 'woocommerce-germanized' ) 
  90. ),  
  91. 'show_ui' => true,  
  92. 'query_var' => true,  
  93. 'public' => false,  
  94. 'capabilities' => array( 
  95. 'manage_terms' => 'manage_product_terms',  
  96. 'edit_terms' => 'edit_product_terms',  
  97. 'delete_terms' => 'delete_product_terms',  
  98. 'assign_terms' => 'assign_product_terms',  
  99. ),  
  100. 'rewrite' => false,  
  101. ) ) 
  102. );