我知道你很久以前就问过这个问题,但没有正确的答案。希望这对您或其他人有所帮助-PBM
function adjust_plugin_menu() {
// remove the existing plugin menu items
remove_submenu_page( 'plugins.php', 'plugins.php' ); // Plugins - Installed Plugins
remove_submenu_page( 'plugins.php', 'plugin-install.php' ); // Plugins - Add New Plugins
remove_submenu_page( 'plugins.php', 'plugin-editor.php' ); // Plugins - Editor
// add in your custom menu item
$destination = "path/to/your/plugin/code" ;
add_plugins_page (
'My Plugin Stuff',
'My Plugin Stuff',
'manage_options',
$destination );
// Put the other menu items back in
add_plugins_page('Installed Plugins', 'Installed Plugins', 'manage_options', 'plugins.php');
add_plugins_page('Add New', 'Add New', 'manage_options', 'plugin-install.php');
add_plugins_page('Editor', 'Editor', 'manage_options', 'plugin-editor.php');
}
add_action('admin_menu', 'adjust_plugin_menu');