WordPress作为z受欢迎的Web应用之一,其功能页越来越多。
有些功能我们用不上,这些功能就会显得多余……文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
比如在WordPress5.8中新增的【站点健康】检查功能。这个功能本来是在一个插件里健康检查与故障排除。为什么要集成到WordPress核心里呢?插件多好,想用就用,不想用就不用。文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
改如何彻底关闭【站点健康】呢。文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
1、禁用【站点健康】所有的【状态】项目文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
// 删除 站点健康->状态 里的项目
function zhuige_remove_site_health($tests)
{
return [];
}
add_filter('site_status_tests', 'zhuige_remove_site_health');
2、禁用【站点健康】所有的【信息】项目文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
// 删除 站点健康->信息 里的项目
function zhuige_remove_debug_info($debug_info)
{
return [];
}
add_filter('debug_information', 'zhuige_remove_debug_info');
3、删除【工具】->【站点健康】菜单文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
// 删除 工具->站点健康 菜单
function zhuige_site_health_menu()
{
remove_submenu_page('tools.php', 'site-health.php');
}
add_action('admin_menu', 'zhuige_site_health_menu');
4、删除【仪表盘】->【站点健康】小工具文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
// 删除 仪表盘->站点健康状态 小工具
function zhuige_remove_dashboard_widget()
{
remove_meta_box('dashboard_site_health', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'zhuige_remove_dashboard_widget');
文章源自小虫博客-https://www.xczi.cn/wordpress/151.html 文章源自小虫博客-https://www.xczi.cn/wordpress/151.html
评论