I am creating a submenu with the following code:
add_action( 'admin_menu', 'jp_create_admin_pages' );
function jp_create_admin_pages()
{
add_menu_page(
'Members',
'Members',
'manage_options',
'members',
'jp_handle_admin_members');
add_submenu_page(
'members',
'Membership Types',
'Membership Types',
'manage_options',
'jp_handle_admin_membership_types');
}
This creates a custom menu called ‘Members’ with two sub-menus: ‘Members’ and ‘Membership Types’.
I want to make it so that the first submenu is called ‘All Members’ instead of ‘Members’ (to mirror the built in menu types). Any ideas?
The first menu item typically is the parent item and shares the name with that item, you can however manually update the entry directly in the
$submenu
variable, like so..That way your parent keeps the original name, whilst the first subitem has another.
Hope that helps.
Have you tried changing the
Menu title
to ‘All Membership Types’?http://codex.wordpress.org/Function_Reference/add_submenu_page
Not sure if it’s possible to do it any other way.
I know what you are trying to achieve, like when registering a custom post type. There is actually a field for
All Items
that’s built into the labels array.