admin管理员组文章数量:1429578
With WP 5.2 now shipping with the "Site Health" page, I'd like to be able to disable this feature -- it shows way too much about the server info.
To remove it from the menu I'm using:
function escode_remove_site_health_feature() {
remove_submenu_page( 'tools.php', 'site-health.php' );
}
add_action( 'admin_menu', 'escode_remove_site_health_feature' );
This works well for removing the page from the admin menu. Now I'd like to disable access to the actual page.
My initial go-to was to check if ('site-health' === $screen->id), and then redirect that to the homepage. It feels a bit hacky though -- is there a more professional approach?
With WP 5.2 now shipping with the "Site Health" page, I'd like to be able to disable this feature -- it shows way too much about the server info.
To remove it from the menu I'm using:
function escode_remove_site_health_feature() {
remove_submenu_page( 'tools.php', 'site-health.php' );
}
add_action( 'admin_menu', 'escode_remove_site_health_feature' );
This works well for removing the page from the admin menu. Now I'd like to disable access to the actual page.
My initial go-to was to check if ('site-health' === $screen->id), and then redirect that to the homepage. It feels a bit hacky though -- is there a more professional approach?
Share Improve this question asked Jun 10, 2019 at 20:59 Best Dev TutorialsBest Dev Tutorials 4451 gold badge7 silver badges21 bronze badges 1 |1 Answer
Reset to default 1I'm not sure if this is what you're looking for, but defining WP_DISABLE_FATAL_ERROR_HANDLER
to true
will disable the site health check entirely according to a post about site health check features in 5.1.
本文标签: admin menuDisable new Site Health screen safely
版权声明:本文标题:admin menu - Disable new Site Health screen safely? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745416242a2657697.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
.htaccess
file to deny access to that URL, or to redirect it to the homepage, etc. – Sally CJ Commented Jun 11, 2019 at 3:09