所以,我在这里有一个WordPress中的自定义帖子类型,一切正常,除非我尝试添加一个新项目并从可视化编辑器切换到文本编辑器,我发现没有可用的按钮。通常在文本编辑器中有这些按钮" B"," i"," link"," ins"," img&# 34;," ul"等等。
它有点奇怪,因为Pages和Posts有这些按钮。下面是我尝试添加自定义帖子类型功能的代码。add_action( 'init', '___regPostType' ) ;
function ___regPostType() {
$labels = array(
'name' => _x('Custom Post Type', 'post type general name'),
'singular_name' => _x('Test Post', 'post type singular name'),
'add_new' => _x('Add New Item', 'test item'),
'add_new_item' => __('Add New Item'),
'edit_item' => __('Edit Item'),
'new_item' => __('New Item'),
'view_item' => __('View Item Page'),
'search_items' => __('Search Item'),
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => 'dashicons-welcome-learn-more',
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
);
register_post_type( 'test' , $args );
}
我不确定这里是否缺少参数或缺少某个功能,但我希望有人能搞清楚......