希望您会发现这一点,我正在添加下面的代码。这是一种方式,你也可以用其他方式做事情。
add_action(\'admin_menu\',\'create_admin_menu\');
function create_admin_menu()
{
add_menu_page (
\'Page Title\',
\'Top level menu Title\',
\'manage_options\',
\'your_unique_slug\',
\'your_magic_function\'
);
function your_magic_function()
{
include_once(\'first.php\');
}
add_submenu_page (
\'your_unique_slug\',
\'\',
\'\',
\'manage_options\',
\'your_unique_slug\',
\'\'
);
add_submenu_page (
\'your_unique_slug\',
\'Submenu2\',
\'Submenu2\',
\'manage_options\',
\'your_unique_submenu_slug1\',
\'your_magic_function2\'
);
function your_magic_function2()
{
include_once(\'second.php\');
}
add_submenu_page (
\'your_unique_slug\',
\'Page Title2\',
\'Submenu Title2\',
\'manage_options\',
\'your_unique_submenu_slug2\',
\'your_magic_function3\'
);
function your_magic_function3()
{
include_once(\'three.php\');
}
}
首先。php
<h1>First</h1>
第二个。php
<h2>Second</h2>
三个。php
<h3>Third</h3>