0
votes

This is a bit of an odd question, as it is very specific to a particular need - simplifying the back end of a WP installation for an inexperienced admin. I know they should go and learn to use the app, but hey... :)

I have built a custom menu in the admin dashboard:

add_menu_page('NewMenu', 'NewMenu', 'administrator', 'new_admin_page', '', plugins_url('newplugin/icon.png'),1);

This puts my "NewMenu" at the top of the Dashboard. All is well. However, I would like to put the standard posts list underneath that menu, as a submenu. Note that it's not a custom post menu, but the basic "edit.php".

I have tried this:

add_submenu_page('NewMenu', 'Posts', 'Posts', 'administrator', 'posts_list', 'edit.php');

It doesn't work. It tries to send me to wp-admin/admin.php?page=posts_list instead of wp-admin/edit.php

Oddly enough, if I change the 'NewMenu' parameter to 'edit.php' it does work (and puts another posts list in the posts menu... yeah, weird).

Can anyone help me out here? I just want to put edit.php inside a custom admin menu. :(

Thanks guys.

1

1 Answers

0
votes

Figured it out. The "edit.php" goes in as the target menu, not the function, and the function is blank:

add_submenu_page('NewMenu', 'Posts', 'Posts', 'administrator', 'edit.php', '');