Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Disable WSOD detection on WordPress 5.1 so that fatal errors during development don't constantly cause plugins to suspend
<?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:
* 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();
Copy link

szepeviktor commented Feb 22, 2019

Maybe the last return serves no purpose.

The file must return the instance of the class that should be registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment