%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/cwg/wp-content/themes/cwg/inc/
Upload File :
Create Path :
Current File : /var/www/cwg/wp-content/themes/cwg/inc/custom-tax.php

<?php

/** 
 *   register custom taxonomies here
 */
// Register Taxonomy Material
function create_material_tax()
{

    $labels = array(
        'name'              => _x('Materials', 'taxonomy general name', 'material'),
        'singular_name'     => _x('Material', 'taxonomy singular name', 'material'),
        'search_items'      => __('Search Materials', 'material'),
        'all_items'         => __('All Materials', 'material'),
        'parent_item'       => __('Parent Material', 'material'),
        'parent_item_colon' => __('Parent Material:', 'material'),
        'edit_item'         => __('Edit Material', 'material'),
        'update_item'       => __('Update Material', 'material'),
        'add_new_item'      => __('Add New Material', 'material'),
        'new_item_name'     => __('New Material Name', 'material'),
        'menu_name'         => __('Material', 'material'),
    );
    $args = array(
        'labels' => $labels,
        'description' => __('', 'material'),
        'hierarchical' => false,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'show_in_nav_menus' => true,
        'show_tagcloud' => false,
        'show_in_quick_edit' => true,
        'show_admin_column' => true,
        'show_in_rest' => true,
    );
    register_taxonomy('material', array('product'), $args);
}
add_action('init', 'create_material_tax');


// Register Taxonomy Color
function create_color_tax()
{

    $labels = array(
        'name'              => _x('Colors', 'taxonomy general name', 'color'),
        'singular_name'     => _x('Color', 'taxonomy singular name', 'color'),
        'search_items'      => __('Search Colors', 'color'),
        'all_items'         => __('All Colors', 'color'),
        'parent_item'       => __('Parent Color', 'color'),
        'parent_item_colon' => __('Parent Color:', 'color'),
        'edit_item'         => __('Edit Color', 'color'),
        'update_item'       => __('Update Color', 'color'),
        'add_new_item'      => __('Add New Color', 'color'),
        'new_item_name'     => __('New Color Name', 'color'),
        'menu_name'         => __('Color', 'color'),
    );
    $args = array(
        'labels' => $labels,
        'description' => __('', 'color'),
        'hierarchical' => false,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'show_in_nav_menus' => true,
        'show_tagcloud' => false,
        'show_in_quick_edit' => true,
        'show_admin_column' => true,
        'show_in_rest' => true,
    );
    register_taxonomy('color', array('product'), $args);
}
add_action('init', 'create_color_tax');

// Register Taxonomy Department
function create_department_tax() {

	$labels = array(
		'name'              => _x( 'Departments', 'taxonomy general name', 'departments' ),
		'singular_name'     => _x( 'Department', 'taxonomy singular name', 'departments' ),
		'search_items'      => __( 'Search Departments', 'departments' ),
		'all_items'         => __( 'All Departments', 'departments' ),
		'parent_item'       => __( 'Parent Department', 'departments' ),
		'parent_item_colon' => __( 'Parent Department:', 'departments' ),
		'edit_item'         => __( 'Edit Department', 'departments' ),
		'update_item'       => __( 'Update Department', 'departments' ),
		'add_new_item'      => __( 'Add New Department', 'departments' ),
		'new_item_name'     => __( 'New Department Name', 'departments' ),
		'menu_name'         => __( 'Department', 'departments' ),
	);
	$args = array(
		'labels' => $labels,
		'description' => __( '', 'departments' ),
		'hierarchical' => false,
		'public' => true,
		'publicly_queryable' => true,
		'show_ui' => true,
		'show_in_menu' => true,
		'show_in_nav_menus' => true,
		'show_tagcloud' => true,
		'show_in_quick_edit' => true,
		'show_admin_column' => false,
		'show_in_rest' => true,
	);
	register_taxonomy( 'department', array('career'), $args );

}
add_action( 'init', 'create_department_tax' );

// Register Taxonomy City
function create_city_tax() {

	$labels = array(
		'name'              => _x( 'Cities', 'taxonomy general name', 'city' ),
		'singular_name'     => _x( 'City', 'taxonomy singular name', 'city' ),
		'search_items'      => __( 'Search Cities', 'city' ),
		'all_items'         => __( 'All Cities', 'city' ),
		'parent_item'       => __( 'Parent City', 'city' ),
		'parent_item_colon' => __( 'Parent City:', 'city' ),
		'edit_item'         => __( 'Edit City', 'city' ),
		'update_item'       => __( 'Update City', 'city' ),
		'add_new_item'      => __( 'Add New City', 'city' ),
		'new_item_name'     => __( 'New City Name', 'city' ),
		'menu_name'         => __( 'City', 'city' ),
	);
	$args = array(
		'labels' => $labels,
		'description' => __( '', 'city' ),
		'hierarchical' => false,
		'public' => true,
		'publicly_queryable' => true,
		'show_ui' => true,
		'show_in_menu' => true,
		'show_in_nav_menus' => true,
		'show_tagcloud' => true,
		'show_in_quick_edit' => true,
		'show_admin_column' => false,
		'show_in_rest' => true,
	);
	register_taxonomy( 'city', array('career'), $args );

}
add_action( 'init', 'create_city_tax' );

Zerion Mini Shell 1.0