这应该与“页面”非常相似。
function gallery_type_custom_init() {
$args = array(
\'public\' => true,
\'label\' => \'Gallery\',
\'capability_type\' => \'page\',
\'hierarchical\' => true,
\'supports\' => array(
\'title\',
\'editor\',
\'thumbnail\',
\'excerpt\',
\'page-attributes\',
\'custom-fields\'
)
);
register_post_type( \'Gallery\', $args );
}
add_action( \'init\', \'gallery_type_custom_init\' );
如果你需要这个来使用
custom page templates, 不过,这行不通。
That part is hard-coded for page
post types only.