Last active
March 19, 2017 08:58
-
-
Save kaorukobo/795d43c9a594b021c2d09fffd2935b37 to your computer and use it in GitHub Desktop.
How to Prevent WordPress from stopping rendering without any error mesages, on PHP 7.1+Wordpress (4.7.2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put these on wp-config.php | |
define('WP_DEBUG', true); | |
define('WP_DEBUG_LOG', true); | |
function custom_exception_handler($exception) | |
{ | |
$logmsg = "Uncaught exception: " . $exception->getMessage() . "\n" . $exception->getTraceAsString() . "\n"; | |
trigger_error($logmsg, E_ERROR); | |
if (WP_DEBUG) { | |
echo($logmsg); | |
} | |
} | |
set_exception_handler('custom_exception_handler'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment