使用操作admin_menu
而不是admin_init
. 您还需要调整remove_submenu_page
要匹配新闻稿添加菜单项的方式,请执行以下操作:
remove_submenu_page( \'newsletter_main_index\', \'newsletter_main_index\' );
remove_submenu_page( \'newsletter_main_index\', \'newsletter_main_main\' );
remove_submenu_page( \'newsletter_main_index\', \'newsletter_main_diagnostic\' );
remove_submenu_page( \'newsletter_main_index\', \'newsletter_subscription_profile\' );