S
S
Sasha Ulych2015-11-15 22:32:31
WordPress
Sasha Ulych, 2015-11-15 22:32:31

How to hide php errors in Wordpress?

site/wp-content/plugins/contact-form-7/modules/submit.php - when accessing this path, it gives errors like (Fatal error: Call to undefined function add_action() in)
How can they be hidden in WordPress?
Tried

ini_set('log_errors','On');
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Doesn't help

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Neocaridina, 2015-11-16
@backflipper

E_ALL does not hide, but on the contrary, displays everything.
php.net/manual/ru/function.error-reporting.php
in the theme header or in functions.php
You can selectively, for yourself, in order to notice or not forget in time:

is_admin() ? error_reporting(E_ALL) : error_reporting(0);

P
Pavel Chesnokov, 2015-11-17
@cesnokov

And I would advise you to correct the error, and not hide it ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question