Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Knowledge Base Categories

if ( ! function_exists( 'hm_register_tax_kb_categories' ) ) {

// Register Custom Taxonomy
function hm_register_tax_kb_categories() {

	$labels = array(
		'name'                       => _x( 'KB Categories', 'Taxonomy General Name', 'hm_kb_categories' ),
		'singular_name'              => _x( 'KB Category', 'Taxonomy Singular Name', 'hm_kb_categories' ),
		'menu_name'                  => __( 'KB Category', 'hm_kb_categories' ),
		'all_items'                  => __( 'All KB Categories', 'hm_kb_categories' ),
		'parent_item'                => __( 'Parent KB Category', 'hm_kb_categories' ),
		'parent_item_colon'          => __( 'Parent KB Category:', 'hm_kb_categories' ),
		'new_item_name'              => __( 'New KB Category Name', 'hm_kb_categories' ),
		'add_new_item'               => __( 'Add New KB Category', 'hm_kb_categories' ),
		'edit_item'                  => __( 'Edit KB Category', 'hm_kb_categories' ),
		'update_item'                => __( 'Update KB Category', 'hm_kb_categories' ),
		'view_item'                  => __( 'View KB Category', 'hm_kb_categories' ),
		'separate_items_with_commas' => __( 'Separate KB Categories with commas', 'hm_kb_categories' ),
		'add_or_remove_items'        => __( 'Add or remove KB Categories', 'hm_kb_categories' ),
		'choose_from_most_used'      => __( 'Choose from the most used', 'hm_kb_categories' ),
		'popular_items'              => __( 'Popular KB Categories', 'hm_kb_categories' ),
		'search_items'               => __( 'Search KB Categories', 'hm_kb_categories' ),
		'not_found'                  => __( 'Not Found', 'hm_kb_categories' ),
		'no_terms'                   => __( 'No KB Categories', 'hm_kb_categories' ),
		'items_list'                 => __( 'KB Categories list', 'hm_kb_categories' ),
		'items_list_navigation'      => __( 'KB Categories list navigation', 'hm_kb_categories' ),
	);
	$args = array(
		'labels'                     => $labels,
		'hierarchical'               => true,
		'public'                     => true,
		'show_ui'                    => true,
		'show_admin_column'          => true,
		'show_in_nav_menus'          => true,
		'show_tagcloud'              => true,
		'show_in_rest'               => true,
	);
	register_taxonomy( 'kb_category', array( 'article' ), $args );

}
add_action( 'init', 'hm_register_tax_kb_categories', 0 );

}