Thể loại phim
// Register Custom Taxonomy
function custom_taxonomy() {
$labels = array(
'name' => 'Thể loại phim',
'singular_name' => 'Thể loại phim',
'menu_name' => 'Thể loại phim',
'all_items' => 'Tất cả',
'parent_item' => 'Thể loại cha',
'parent_item_colon' => 'Thể loại cha:',
'new_item_name' => 'Thể loại mới',
'add_new_item' => 'Thêm thể loại',
'edit_item' => 'Sửa thể loại',
'update_item' => 'Cập nhật thể loại',
'view_item' => 'Xem thể loại',
'separate_items_with_commas' => 'Dấu phân cách mỗi thể loại',
'add_or_remove_items' => 'Thêm hoặc xóa thể loại',
'choose_from_most_used' => 'Chọn thể loại được sử dụng nhiều',
'popular_items' => 'Thể loại nổi bật',
'search_items' => 'Tìm kiếm thể loại',
'not_found' => 'Không tim thấy thể loại',
);
$rewrite = array(
'slug' => 'the-loai',
'with_front' => true,
'hierarchical' => false,
);
$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,
);
register_taxonomy( 'movie_category', array( 'movie' ), $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_taxonomy', 0 );