Try adding to wp-config.php:
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
Add near the bottom, just above the line:
/* That's all, stop editing! Happy blogging. */
Thread Starter
crslz
(@crslz)
Hi,
I already know that function, I want to do it via code from a self-written plugin.
https://github.com/WordPress/WordPress/blob/master/wp-includes/load.php#L810
The use of the arrow (->) is an OOP construct to access the properties and methods contained in a given object:
call object with properties is_initialized or is_active.
Thread Starter
crslz
(@crslz)
Hi,
If I use this
adding to wp-config.php:
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
or this
theme’s functions.php file add the following line:
add_filter( ‘wp_fatal_error_handler_enabled’, ‘__return_false’ );
It makes no difference, it both doesn’t work.
I think I have found the problem but can someone confirm this? My local test installation (Ampss) uses php 7.1 and I think that for the above functions php 7.2 is required, could this be correct?
I have no possibility to test this with a higher php version because Ampps has no update yet.
Thread Starter
crslz
(@crslz)
@autotutorial
I could find this about it
‘Setting the WP_DEBUG as true will not disable the WSOD protection. This is by design’. However, when using WP_DEBUG on false and
add_filter( ‘wp_fatal_error_handler_enabled’, ‘__return_false’ );
This seems to make no difference, I think the function is not working properly or it is the use of the php version (see my previous message)
The code involved has little bearing on PHP version. WP will work in any version equal to or later than 5.6.20.
I hope your code is using proper syntax and not the “curly” quotes in your posted snippet 🙂
It could be a plugin is overriding your filter. Try adding with a large priority argument:
add_filter( 'wp_fatal_error_handler_enabled', '__return_false', PHP_INT_MAX );
If you are using a WP version that is host provided, such as from a one click install or a managed WP package, some hosts modify WP core for their environment. If this is the case, disabling the error handler could prove to be difficult.