您可以拦截全局$submenu
var并添加所需的元素:
add_action(\'admin_menu\', \'add_custom_submenus\', 999);
function add_custom_submenus() {
global $submenu;
$submenu[\'edit.php\'][] = array(
__(\'Published\'), // menu title
\'edit_posts\', // menu cap
\'edit.php?post_status=publish&post_type=post\' // menu link
);
$submenu[\'edit.php\'][] = array(
__(\'Scheduled\'),
\'edit_posts\',
\'edit.php?post_status=future&post_type=post\'
);
$submenu[\'upload.php\'][] = array(
__(\'Unattached\'),
\'upload_files\',
\'upload.php?detached=1\'
);
}