admin管理员组

文章数量:1292702

I have added few pages to handle edit, view page that is should not be accessed from wp-admin navigation menu and its a success. But now on my menu, I have empty space as sub-menu.

Below are my codes to add pages.

add_submenu_page('iuser_dashboard_page', 'Edit iUser', null, 'manage_options', 'i_edit_user', 'IEdit_User');
add_submenu_page('iuser_dashboard_page', 'User membership detail', '', 'manage_options', 'view_user_membership_detail', 'view_user_membership_detail');
add_submenu_page('iuser_dashboard_page', 'User enrollment', '', 'manage_options', 'view_user_enrollment', 'view_user_enrollment');

But how to remove the empty submenu from the navigation menu?

Thank you in advanced.

Edit for answer:

Not able to use CSS to hide it. so I use JQuery instead.

$( document ).ready(function() {
    $('a:empty').css('display', 'none'); 
});

本文标签: How to remove empty menu space when creating admin page without menu title using addsubmenupage