我在插件中注册了2个自定义帖子类型,其中一个显示在左侧的管理栏中,第二个我不会显示,因此我将“show\\u ui”设置为false。
是否可以将第二个帖子类型添加到第一个帖子类型的菜单中?
first post type:
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'has_archive\' => false,
\'menu_position\' => 100,
\'supports\' => array( \'title\', \'editor\', \'custom-fields\', \'thumbnail\' ),
\'menu_icon\' => plugins_url( \'assets/img/small1.png\', __FILE__ ),
\'rewrite\' => array(\'slug\' => \'screenshots\', \'with_front\' => true)
);
register_post_type( \'screenshots\', $args );
second post type:
$args = array(
\'show_ui\' => false,
\'labels\' => $labels,
\'public\' => true,
\'has_archive\' => false,
//\'menu_position\' => 100,
\'supports\' => array( \'title\', \'editor\', \'custom-fields\', \'thumbnail\' ),
//\'menu_icon\' => plugins_url( \'assets/img/small2.png\', __FILE__ ),
\'rewrite\' => array(\'slug\' => \'deal\', \'with_front\' => true)
);
register_post_type( \'deals\', $args );
I try to add the second post type with:
add_submenu_page( \'edit.php?post_type=deals\', __(\'Deal\', $this->var_sTextdomain), __(\'Deal\', $this->var_sTextdomain), \'manage_options\', \'my-deal\', array(&$this, \'deal_page\') );
如何将其添加到末尾的第一个帖子类型中?
当做