PHP code example of renakdup / whoops-wordpress-error-handler

1. Go to this page and download the library: Download renakdup/whoops-wordpress-error-handler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

renakdup / whoops-wordpress-error-handler example snippets


   
   // This checks necessary if you use the package as a dev dependency
   if ( ! class_exists( Renakdup\WhoopsErrorHandler\ErrorHandler::class ) ) {
        return;
   }
   
   $error_handler = new Renakdup\WhoopsErrorHandler\ErrorHandler();
   $error_handler->init();
   

add_filter( 'renakdup/whoops-error-handler/prohibited-envs', function ( $defaults ) {
	return array_merge( $defaults, [ 'staging', 'development' ] );
}, 10, 1);

add_filter( 'renakdup/whoops-error-handler/not-enable', function ( $default ) {
	if ( ! WP_DEBUG || ! WP_DEBUG_DISPLAY ) {
		return true;
	}
}, 10, 1);

$name = 'material-dark-smooth';

$name = 'material-dark';

$name = 'gray';

$name = 'original-optimized';

$name = 'default-original';