Added Supplier taxonomy
This commit is contained in:
@@ -4,6 +4,7 @@ class Wiaas_Product {
|
||||
|
||||
public static function init() {
|
||||
require_once dirname( __FILE__ ) . '/product/class-wiaas-product-category.php';
|
||||
require_once dirname( __FILE__ ) . '/product/class-wiaas-product-supplier.php';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
class Wiaas_Product_Supplier {
|
||||
public static function init() {
|
||||
|
||||
add_action('init', array( __CLASS__, 'register_supplier_taxonomy' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register wiaas template category taxonomy
|
||||
*/
|
||||
public static function register_supplier_taxonomy() {
|
||||
|
||||
$labels = array(
|
||||
'name' => _x( 'Supplier', 'taxonomy general name', 'wiaas' ),
|
||||
'singular_name' => _x( 'Supplier', 'taxonomy singular name', 'wiaas' ),
|
||||
'search_items' => __( 'Search Suppliers', 'wiaas' ),
|
||||
'all_items' => __( 'All Suppliers', 'wiaas' ),
|
||||
'parent_item' => __( 'Parent Supplier', 'wiaas' ),
|
||||
'parent_item_colon' => __( 'Parent Supplier', 'wiaas' ),
|
||||
'edit_item' => __( 'Edit Supplier', 'wiaas' ),
|
||||
'update_item' => __( 'Update Supplier', 'wiaas' ),
|
||||
'add_new_item' => __( 'Add New Supplier', 'wiaas' ),
|
||||
'new_item_name' => __( 'New Supplier Name', 'wiaas' ),
|
||||
'menu_name' => __( 'Supplier', 'wiaas' ),
|
||||
);
|
||||
|
||||
$args = array(
|
||||
'hierarchical' => false,
|
||||
'labels' => $labels,
|
||||
'show_ui' => true,
|
||||
'show_admin_column' => true,
|
||||
'query_var' => true,
|
||||
'rewrite' => array( 'slug' => 'template_category' ),
|
||||
);
|
||||
|
||||
register_taxonomy( 'supplier', array( 'product' ), $args );
|
||||
}
|
||||
}
|
||||
|
||||
Wiaas_Product_Supplier::init();
|
||||
Reference in New Issue
Block a user