Answers:
是的,从您的自定义帖子类型中删除编辑器支持。
您可以通过两种方式来实现。
例:
$args = array(
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'has_archive' => true,
'supports' => array('title','author','thumbnail','excerpt','comments')
);
register_post_type('book',$args);
2.如果您的代码未定义自定义帖子类型,则使用remove_post_type支持(即其他一些插件/主题定义了自定义帖子类型)。
例:
add_action('init', 'my_rem_editor_from_post_type');
function my_rem_editor_from_post_type() {
remove_post_type_support( <POST TYPE>, 'editor' );
}
注册自定义帖子类型时,请不要指定对编辑器的支持。
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
// on the supports param here you see no 'editor'
'supports' => array('title','author','thumbnail','excerpt','comments')
);
register_post_type('book',$args);
更多信息,请参见:功能参考/注册职位类型。