_x( 'Room Types', 'taxonomy general name', 'wp-bnb' ), 'singular_name' => _x( 'Room Type', 'taxonomy singular name', 'wp-bnb' ), 'search_items' => __( 'Search Room Types', 'wp-bnb' ), 'all_items' => __( 'All Room Types', 'wp-bnb' ), 'parent_item' => __( 'Parent Room Type', 'wp-bnb' ), 'parent_item_colon' => __( 'Parent Room Type:', 'wp-bnb' ), 'edit_item' => __( 'Edit Room Type', 'wp-bnb' ), 'update_item' => __( 'Update Room Type', 'wp-bnb' ), 'add_new_item' => __( 'Add New Room Type', 'wp-bnb' ), 'new_item_name' => __( 'New Room Type Name', 'wp-bnb' ), 'menu_name' => __( 'Room Types', 'wp-bnb' ), 'back_to_items' => __( '← Back to Room Types', 'wp-bnb' ), 'not_found' => __( 'No room types found.', 'wp-bnb' ), ); $args = array( 'labels' => $labels, 'hierarchical' => true, // Hierarchical (like categories). 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_rest' => true, 'show_in_quick_edit' => true, 'show_admin_column' => true, 'rewrite' => array( 'slug' => 'room-type', 'with_front' => false, 'hierarchical' => true, ), 'query_var' => true, 'capabilities' => array( 'manage_terms' => 'manage_options', 'edit_terms' => 'manage_options', 'delete_terms' => 'manage_options', 'assign_terms' => 'edit_posts', ), ); register_taxonomy( self::TAXONOMY, array( 'bnb_room' ), $args ); } /** * Add custom fields to the add term form. * * @return void */ public static function add_form_fields(): void { ?>

term_id, 'room_type_base_capacity', true ); $sort_order = get_term_meta( $term->term_id, 'room_type_sort_order', true ); ?>

}> */ public static function get_default_terms(): array { return array( __( 'Standard', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 10, 'children' => array( __( 'Single', 'wp-bnb' ) => array( 'capacity' => 1, 'order' => 11, ), __( 'Double', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 12, ), __( 'Twin', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 13, ), ), ), __( 'Superior', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 20, ), __( 'Suite', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 30, 'children' => array( __( 'Junior Suite', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 31, ), __( 'Executive Suite', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 32, ), ), ), __( 'Family', 'wp-bnb' ) => array( 'capacity' => 4, 'order' => 40, ), __( 'Accessible', 'wp-bnb' ) => array( 'capacity' => 2, 'order' => 50, ), __( 'Apartment', 'wp-bnb' ) => array( 'capacity' => 4, 'order' => 60, ), ); } }