How to customize the critical error message?

How to customize the critical error message saying:There has been a critical error on your website.Learn more about deb

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 badges
Add a comment  | 

1 Answer 1

Reset to default 3

You 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742278768a4414094.html

相关推荐

  • How to customize the critical error message?

    How to customize the critical error message saying:There has been a critical error on your website.Learn more about deb

    22小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信