我想在我的插件中创建一个名为custompage
的新页面
我不想在主菜单列表中添加页面..
如果可能的话??
try this
add_action( 'admin_menu', 'register_newpage' );
function register_newpage(){
add_menu_page('custom_page', 'custom', 'administrator','custom', 'custompage');
remove_menu_page('custom');
}
在您的插件中添加以下代码:
add_action( 'admin_menu', 'register_newpage' );
function register_newpage(){
add_menu_page( 'newpage title', '', 'manage_options', 'myplugin/newpage.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
}