WordPress如何彻底关闭站点健康检测功能

admin wordpress评论2331

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

admin


  • ·版权声明·



    1、本站文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系客服进行删除处理。
    2、本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
    3、如有侵权请邮件admin@xczi.cn与我们联系处理。敬请谅解!


  • 转载请务必保留本文链接:WordPress如何彻底关闭站点健康检测功能-https://www.xczi.cn/wordpress/151.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: