好的,我的坏蛋在抄本页面上找到了答案,但在最下面,所以我也在这里添加了这个,所以如果像我这样的人没有在WordPress的抄本上找到它,他们可以在这里找到:)
仅使用get_admin_page_title();
See the example 1 below:
function register_my_custom_submenu_page() {
add_submenu_page(
\'tools.php\',
\'My Custom Submenu Page\',
\'My Custom Submenu Page\',
\'manage_options\',
\'my-custom-submenu-page\',
\'my_custom_submenu_page_callback\'
);
}
function my_custom_submenu_page_callback() {
echo \'<div class="wrap"><div id="icon-tools" class="icon32"></div>\';
echo get_admin_page_title();
echo \'</div>\';
}
And here is the example 2 below:
function register_my_custom_submenu_page() {
add_submenu_page(
\'tools.php\',
\'My Custom Submenu Page\',
\'My Custom Submenu Page\',
\'manage_options\',
\'my-custom-submenu-page\',
\'my_custom_submenu_page_callback\'
);
}
function my_custom_submenu_page_callback() {
global $title;
echo \'<div class="wrap"><div id="icon-tools" class="icon32"></div>\';
echo $title;
echo \'</div>\';
}