我相信我所努力达到的目标是相当容易的,但我没有抓住这里所需要的东西。
我想要管理小组的一个部分..。让我们说“页面部分”
在这种情况下,我希望能够添加多个post类型。也就是说,让我们说
“添加成员”,“添加foo",”添加条“.
我现在有
add_action( 'init', 'add_item' );
add_action( 'init', 'add_item2' );
function add_item(){
register_post_type('item1', array(
'label' => 'Item label',
'public' => true,
'show_ui' => true,
'capability_type' => 'page',
'capabilities' => array(
),
'hierarchical' => true,
'rewrite' => array('slug' => 'puds'),
'query_var' => true,
'supports' => array(
'title',
'editor',
'excerpt',
'custom-fields',
'revisions',
'thumbnail',
'author',
'page-attributes',
'post-formats'
)
) );
}
function add_item2(){
register_post_type('item2', array(
'label' => 'Item label 2',
'public' => true,
'show_ui' => true,
'capability_type' => 'page',
'capabilities' => array(
),
'hierarchical' => true,
'rewrite' => array('slug' => 'puds'),
'query_var' => true,
'supports' => array(
'title',
'editor',
'excerpt',
'custom-fields',
'revisions',
'thumbnail',
'author',
'page-attributes',
'post-formats'
)
) );}
这会产生

但我想要一个菜单标题有多个菜单选择..。
有什么想法吗?
发布于 2012-08-17 01:32:01
对不起,试试这个:
'show_ui' => false,
'menu_position' => 'edit.php?post_type=main_posttype or registered section'例如,如果您希望将其放在主题下,则如下所示:
'menu_position' => 'themes.php'这是在您的帖子类型注册。
https://wordpress.stackexchange.com/questions/62045
复制相似问题