【WordPress】移除后台管理界面的功能菜单
作者:互联网
只需要在主题的funcations.php文件中增加以下代码,具体是否需要移除哪些菜单可以根据需要自己来注释掉对应的代码
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
add_action('admin_menu', 'remove_menus', 102);
function remove_menus()
{
global $submenu;
remove_menu_page( 'edit.php' ); // Posts
remove_menu_page( 'upload.php' ); // Media
remove_menu_page( 'link-manager.php' ); // Links
remove_menu_page( 'edit-comments.php' ); // Comments
//remove_menu_page( 'edit.php?post_type=page' ); // Pages
remove_menu_page( 'plugins.php' ); // Plugins
//remove_menu_page( 'themes.php' ); // Appearance
remove_menu_page( 'users.php' ); // Users
remove_menu_page( 'tools.php' ); // Tools
//remove_menu_page(‘options-general.php’); // Settings
remove_submenu_page ( 'index.php', 'update-core.php' ); //Dashboard->Updates
remove_submenu_page ( 'themes.php', 'themes.php' ); // Appearance-->Themes
remove_submenu_page ( 'themes.php', 'widgets.php' ); // Appearance-->Widgets
remove_submenu_page ( 'themes.php', 'theme-editor.php' ); // Appearance-->Editor
remove_submenu_page ( 'options-general.php', 'options-general.php' ); // Settings->General
remove_submenu_page ( 'options-general.php', 'options-writing.php' ); // Settings->writing
remove_submenu_page ( 'options-general.php', 'options-reading.php' ); // Settings->Reading
remove_submenu_page ( 'options-general.php', 'options-discussion.php' ); // Settings->Discussion
remove_submenu_page ( 'options-general.php', 'options-media.php' ); // Settings->Media
remove_submenu_page ( 'options-general.php', 'options-privacy.php' ); // Settings->Privacy
}
|
参考:Remove Menus in WordPress Admin Menu and Dashboard
标签:submenu,菜单,menu,remove,options,WordPress,移除,php,page 来源: https://www.cnblogs.com/thspz/p/12047931.html