尝试以下操作:在load hook中,可以输出xml代码。U
function my_menu_pages() {
$hook = add_submenu_page(
null, \'Page Title\', \'Page Title\', \'administrator\', \'sub-menu-slug\', function() {
}
);
add_action(\'load-\' . $hook, function() {
// add your xml code here,
// you will get a blank page to start with
exit;
});
}
add_action(\'admin_menu\', \'my_menu_pages\');