<?php

/**
 * Custom taxonomies
 * @see codex.wordpress.org/Function_Reference/register_taxonomy
 * @category Functions
 * @author Krik
 */

// Genres@Book taxonomy
// add_action('init', 'krik_genres_taxonomy');

add_action('init', 'krik_board_taxonomy');

function krik_board_taxonomy()
{
	$labels = array(
		'name' => __('Boards', 'krik'),
		'singular_name' => __('Board', 'krik'),
		'search_items' => __('Search Boards', 'krik'),
		'all_items' => __('All Boards', 'krik'),
		'parent_item' => __('Parent Board', 'krik'),
		'parent_item_colon' => __('Parent Board:', 'krik'),
		'edit_item' => __('Edit Board', 'krik'),
		'update_item' => __('Update Board', 'krik'),
		'add_new_item' => __('Add New Board', 'krik'),
		'new_item_name' => __('New Board Name', 'krik'),
		'menu_name' => __('Board', 'krik'),
	);
	$args = array(
		'hierarchical' => true,
		'labels' => $labels,
		'show_ui' => true,
		'show_admin_column' => true,
		'query_var' => true,
		'rewrite' => array('slug' => 'board'),
		'show_in_rest' => true
	);
	register_taxonomy('board', 'member', $args);
}

function krik_genres_taxonomy()
{
	$labels = array(
		'name' => __('Genres', 'krik'),
		'singular_name' => __('Genre', 'krik'),
		'search_items' => __('Search Genres', 'krik'),
		'all_items' => __('All Genres', 'krik'),
		'parent_item' => __('Parent Genre', 'krik'),
		'parent_item_colon' => __('Parent Genre:', 'krik'),
		'edit_item' => __('Edit Genre', 'krik'),
		'update_item' => __('Update Genre', 'krik'),
		'add_new_item' => __('Add New Genre', 'krik'),
		'new_item_name' => __('New Genre Name', 'krik'),
		'menu_name' => __('Genre', 'krik'),
	);
	$args = array(
		'hierarchical' => true,
		'labels' => $labels,
		'show_ui' => true,
		'show_admin_column' => true,
		'query_var' => true,
		'rewrite' => array('slug' => 'genre'),
		'show_in_rest' => true
	);
	register_taxonomy('genre', 'book', $args);
}
