admin管理员组文章数量:1333210
How to customize the critical error message saying:
There has been a critical error on your website.
Learn more about debugging in WordPress.
Instead of using CSS to hide the message it would be interesting to be able to point the link to another source than the community article.
How to customize the critical error message saying:
There has been a critical error on your website.
Learn more about debugging in WordPress.
Instead of using CSS to hide the message it would be interesting to be able to point the link to another source than the community article.
Share Improve this question asked Jul 9, 2020 at 12:23 RafaSashiRafaSashi 5071 gold badge7 silver badges17 bronze badges1 Answer
Reset to default 3You can use the wp_php_error_message
filter to customise this message:
add_filter(
'wp_php_error_message',
function( $message, $error ) {
return 'My custom message.';
},
10,
2
);
I haven't tested to be sure, but I would assume that if the critical error that causes this message happens to be in the code of same theme or plugin that this filter is used in, or a theme or plugin loaded before it, then this filter would likely not apply.
If you want to change this message independently of your theme and plugins, this might be a good use case for a Must Use Plugin.
本文标签: How to customize the critical error message
版权声明:本文标题:How to customize the critical error message? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742278767a2445700.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论