Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Turn on WordPress' WP_DEBUG_LOG but without E_STRICT. Accompanying blog post:
Plugin Name: Debug Log Not Strict
Plugin URI:
Description: Turn on WP_DEBUG_LOG but without E_STRICT
Version: 1.3.0
Author: WebAware
Author URI:
* turn on WP_DEBUG_LOG but without E_STRICT
$ignore = E_STRICT;
// also ignore PHP deprecated notices
$ignore |= E_DEPRECATED;
// also ignore WordPress deprecated notices
add_filter('doing_it_wrong_trigger_error', '__return_false');
error_reporting(E_ALL ^ $ignore);
ini_set('log_errors', 1);
ini_set('display_errors', 0);
ini_set('error_log', WP_CONTENT_DIR . '/debug.log');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.