Disable php error reporting in WordPress

WordPress的报错,有些插件可能不符合当前版本的wordpress,于是就会出现php error,php error用WP_DEBUG是关不掉的,于是就使用

error_reporting(0);

来关闭php error

这段code需要放在wp-config.php 的 wp-settings.php 之后,否则错误会被WordPress自己的setting覆盖掉。

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

error_reporting(0);

参考链接:https://wordpress.org/support/topic/disable-error-reporting-in-wordpress/

382 total views, 2 views today

Revisions

There are no revisions for this post.

No comments yet.

发表评论