Last active
March 22, 2019 18:48
-
-
Save westonruter/583a42392a0b8684dc268b40d44eb7f1 to your computer and use it in GitHub Desktop.
Disable WSOD detection on WordPress 5.1 so that fatal errors during development don't constantly cause plugins to suspend
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
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName | |
/* | |
* Plugin Name: Non-Handling Shutdown Handler | |
* Description: Disable WSOD protection so that plugins will not auto-suspend during development while errors often occur. | |
* Plugin URI: https://gist.github.com/westonruter/583a42392a0b8684dc268b40d44eb7f1 | |
* Plugin Author: Weston Ruter | |
*/ | |
/** | |
* Class Non_Handling_Shutdown_Handler | |
*/ | |
class Non_Handling_Shutdown_Handler extends WP_Shutdown_Handler { | |
/** | |
* Override the shutdown handler to no-op. | |
*/ | |
public function handle() { | |
// No-op. | |
} | |
} | |
return new Non_Handling_Shutdown_Handler(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe the lastreturn
serves no purpose.https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-shutdown-handler.php?rev=44524