0°

几行代码快速去除Wordpress管理后台仪表盘模块

想要删除Wordpress管理后台中的活动、快速草稿、概览和 WordPress 活动及新闻等模块,只需要将下面的代码添加到当前主题的 functions.php 文件中即可:

//删除 WordPress 后台仪表盘
function disable_dashboard_widgets() {
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
}
add_action('wp_dashboard_setup', 'disable_dashboard_widgets', 999);
「点点赞赏,手留余香」

1人已赞赏

  • Q哥

    ¥2.00

⋆ 王牌网络(WPOK.CN),Q哥的网赚博客

⋆ 专注网站建设、推广营销、网赚项目,公众号:王牌网络(WPOK-CN)

⋆ QQ/微信:860056696

0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论