From looking at the codex and after using print_r($GLOBALS['menu'];
to display the array list of menu items, I see my CPTs listed as
16,17,18,19
in the returned array. 20
is the Pages
menu item, and 15
as the Links
menu item. I have a settings plugin which I wish to display with my Custom Posts. If I add
add_menu_page( 'Settings', 'Settings', 'manage_options', 'plugin_name', 'plugin_name_options_page', content_url( '/img/icon.png', __FILE__), 20 );
Then the Pages
menu item is overwritten completely by my plugin entry, rather than being moved to 21
etc.
The array for the Posts section in the menu seems to end at 25, so I was thinking I have two options;
- Figure out how to insert my plugin into the menu array as
20
and move the other pages in the array further along by1
. - Manually set the menu number for my plugin and my CPTs. I have the plugin menu code - how and where do I add similar functionality in my custom posts code?