所以我用 register_post_type 添加书籍 post_type 部分。
但我想在后面板 edit.php 上显示类别和标签(以及更多)。
我知道如何在常规帖子中执行此操作(添加自定义字段)。
add_action( 'init', 'bookworm_blog_cpt' );
function bookworm_blog_cpt() {
register_post_type( 'book', array(
'labels' => array(
'name' => 'Books',
'singular_name' => 'Book',
),
'description' => 'Books which we will be discussing on this blog.',
'public' => true,
'menu_position' => 20,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'custom-fields' )
));
}