I have a group of custom post types such as “CPT A”, “CPT B” and “CPT C”. I display the admin page for each of these as subpages under a common Admin page.
add_menu_page('Console',
'Console',
'plugin_console',
'plugin',
array ( $this, 'page_main' ),
"http://example.com/favicon.ico",
6
);
There are also custom taxonomies for the CPTs, and some of them are shared.
What I’m to do is, in the admin pane add submenu page off the main one that links to the taxonomies in edit-tags.php.
add_submenu_page('plugin',
'Taxonomy',
'Taxonomy',
'manage_options',
'plugin-taxonomy',
array( $this, 'page_taxonomy' )
);
The problem I encounter is that the list table doesn’t fill. Any suggestions on a good/better approach are most welcome.
Just as a follow up, I want a menu that looks something like:
-Console
--CPT A
--CPT B
--CPT C
--Taxonomy 1
--Taxonomy 2
We could manipulate the global
$menu
and$submenu
inside theadmin_menu
hook. But it’s easier to let Mike Schinkel’s WP Admin Menu Classes take care of it.