Skip to content

Instantly share code, notes, and snippets.

@martymcguire
Forked from westonruter/shutdown-handler.php
Created February 18, 2019 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martymcguire/c14d360d396d8d635728ad82b674eb4f to your computer and use it in GitHub Desktop.
Save martymcguire/c14d360d396d8d635728ad82b674eb4f 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
<?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