Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

kategorie produktów

// Register Custom Taxonomy
function registerProductsCategories() {

	$labels = array(
		'name'                       => _x( 'Product categories', 'Taxonomy General Name', 'narva' ),
		'singular_name'              => _x( 'Product category', 'Taxonomy Singular Name', 'narva' ),
		'menu_name'                  => __( 'Product Categories', 'narva' ),
		'all_items'                  => __( 'All categories', 'narva' ),
		'parent_item'                => __( 'Parent category', 'narva' ),
		'parent_item_colon'          => __( 'Parent category:', 'narva' ),
		'new_item_name'              => __( 'Category name', 'narva' ),
		'add_new_item'               => __( 'Add New category', 'narva' ),
		'edit_item'                  => __( 'Edit category', 'narva' ),
		'update_item'                => __( 'Update category', 'narva' ),
		'view_item'                  => __( 'View category', 'narva' ),
		'separate_items_with_commas' => __( 'Separate categories with commas', 'narva' ),
		'add_or_remove_items'        => __( 'Add or remove categories', 'narva' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'narva' ),
		'popular_items'              => __( 'Popular categories', 'narva' ),
		'search_items'               => __( 'Search categories', 'narva' ),
		'not_found'                  => __( 'Not Found', 'narva' ),
	);
	$rewrite = array(
		'slug'                       => 'product_category',
		'with_front'                 => true,
		'hierarchical'               => true,
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'rewrite'                    => $rewrite,
	);
	register_taxonomy( 'category_products', array( 'product' ), $args );

}

// Hook into the 'init' action
add_action( 'init', 'registerProductsCategories', 0 );