我正在写一个插件,因为我们的主要网站最终将被移植到WordPress。我已经为这个插件计划了多个自定义帖子类型,并希望将它们全部组合到一个主菜单中。
大体上I want the "Visitors" link to be placed under "Argus Admin". 没有必要添加其他链接,因为我可以在任何地方“黑客”这些链接。
$v_args = array(
\'labels\' => array (
\'name\' => \'Visitors\',
\'singular_name\' => \'Visitor\',
\'add_new_item\' => \'Register New Visitor\', // TODO: http://codex.wordpress.org/Function_Reference/register_post_type#Arguments
),
\'public\' => true,
\'publicly_queryable\' => false,
\'exclude_from_search\' => true,
\'show_ui\' => true,
\'show_in_menu\' => \'argus\', // TODO: This doesn\'t work...
\'hiearchical\' => false,
\'supports\' => array( \'\' ),
\'register_meta_box_cb\' => array ( &$this, \'_wp_visitor_meta_box_cb\' ),
);
register_post_type( $post_type, $v_args );
我创建的“我的菜单”页面:add_menu_page( \'Argus\', \'Argus Admin\', \'manage_options\', \'argus\', array( &$this, \'_wp_argus_main_panel\' ), \'\', -1 );