<?php
/**
 * File Path: includes/taxonomies/class-mbs-taxonomy-theme.php
 *
 * Tropes Taxonomy
 *
 * Flat (non-hierarchical) taxonomy for author-defined narrative tropes (found family, enemies to lovers, slow burn, etc.). Ships with a
 * curated default term list seeded by MBS_Theme_Seeder; admins may add
 * free terms via the WP taxonomy admin screen.
 *
 * Assignment in the book editor is handled by the shared MBS_Metabox_Categorization
 * panel (Tags | Themes | Warnings tabs). The default WP tag-style sidebar
 * metabox is suppressed by that class.
 *
 * show_in_menu is false; MBS_Admin::add_menu() registers any desired submenu
 * manually (MENU-01 pattern).
 *
 * @package    My_Book_Showroom
 * @subpackage Includes/Taxonomies
 * @since      1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class MBS_Taxonomy_Theme {

	public static function register(): void {
		$labels = array(
			'name'                       => __( 'Tropes', 'my-book-showroom' ),
			'singular_name'              => __( 'Trope', 'my-book-showroom' ),
			'menu_name'                  => __( 'Tropes', 'my-book-showroom' ),
			'search_items'               => __( 'Search Tropes', 'my-book-showroom' ),
			'popular_items'              => __( 'Popular Tropes', 'my-book-showroom' ),
			'all_items'                  => __( 'All Tropes', 'my-book-showroom' ),
			'edit_item'                  => __( 'Edit Trope', 'my-book-showroom' ),
			'update_item'                => __( 'Update Trope', 'my-book-showroom' ),
			'add_new_item'               => __( 'Add New Trope', 'my-book-showroom' ),
			'new_item_name'              => __( 'New Trope Name', 'my-book-showroom' ),
			'separate_items_with_commas' => __( 'Separate tropes with commas', 'my-book-showroom' ),
			'add_or_remove_items'        => __( 'Add or remove tropes', 'my-book-showroom' ),
			'choose_from_most_used'      => __( 'Choose from the most used tropes', 'my-book-showroom' ),
			'not_found'                  => __( 'No tropes found.', 'my-book-showroom' ),
		);

		register_taxonomy(
			MBS_TAX_THEME,
			MBS_POST_TYPE,
			array(
				'labels'            => $labels,
				'hierarchical'      => false,
				'public'            => true,
				'show_ui'           => true,
				'show_in_rest'      => true,
				'show_admin_column' => false,
				'rewrite'           => array( 'slug' => 'book-theme' ),
				// MENU-01: Prevent auto-attachment to edit.php?post_type=mbs_book.
				'show_in_menu'      => false,
				'show_in_quick_edit' => false,
			)
		);
	}
}
