Book category
if ( ! function_exists( 'syt_custom_book' ) ) {
// Register Custom Taxonomy
function syt_custom_book() {
$labels = array(
'name' => _x( 'Books', 'Taxonomy General Name', 'sytech' ),
'singular_name' => _x( 'Book', 'Taxonomy Singular Name', 'sytech' ),
'menu_name' => __( 'Book', 'sytech' ),
'all_items' => __( 'All Books', 'sytech' ),
'parent_item' => __( 'Parent Book', 'sytech' ),
'parent_item_colon' => __( 'Parent Book:', 'sytech' ),
'new_item_name' => __( 'New Book Name', 'sytech' ),
'add_new_item' => __( 'Add New Book', 'sytech' ),
'edit_item' => __( 'Edit Book', 'sytech' ),
'update_item' => __( 'Update Book', 'sytech' ),
'view_item' => __( 'View Book', 'sytech' ),
'separate_items_with_commas' => __( 'Separate books with commas', 'sytech' ),
'add_or_remove_items' => __( 'Add or remove books', 'sytech' ),
'choose_from_most_used' => __( 'Choose from the most used', 'sytech' ),
'popular_items' => __( 'Popular Books', 'sytech' ),
'search_items' => __( 'Search Books', 'sytech' ),
'not_found' => __( 'Not Found', 'sytech' ),
'no_terms' => __( 'No Books', 'sytech' ),
'items_list' => __( 'Books list', 'sytech' ),
'items_list_navigation' => __( 'Books list navigation', 'sytech' ),
);
$rewrite = array(
'slug' => 'book',
'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,
'show_in_rest' => true,
'rest_base' => 'book',
);
register_taxonomy( 'book', array( 'book_page' ), $args );
}
add_action( 'init', 'syt_custom_book', 0 );
}