Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Turn on WordPress' WP_DEBUG_LOG but without E_STRICT. Accompanying blog post: http://snippets.webaware.com.au/snippets/wordpress-wp_debug_log-without-e_strict/
<?php
/*
Plugin Name: Debug Log Not Strict
Plugin URI: https://gist.github.com/webaware/6520892
Description: Turn on WP_DEBUG_LOG but without E_STRICT
Version: 1.3.0
Author: WebAware
Author URI: https://shop.webaware.com.au/
*/
/**
* turn on WP_DEBUG_LOG but without E_STRICT
*/
$ignore = E_STRICT;
if (defined('DEBUG_IGNORE_DEPRECATED') && DEBUG_IGNORE_DEPRECATED) {
// also ignore PHP deprecated notices
$ignore |= E_DEPRECATED;
}
if (defined('DEBUG_IGNORE_WP_DEPRECATED') && DEBUG_IGNORE_WP_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.