Skip to content

Instantly share code, notes, and snippets.

@erwstout
Created December 10, 2020 20:25
Show Gist options
  • Save erwstout/b7202c1b06dd9017b0b33e53f1419aa6 to your computer and use it in GitHub Desktop.
Save erwstout/b7202c1b06dd9017b0b33e53f1419aa6 to your computer and use it in GitHub Desktop.
WordPress Logger
if (!function_exists('log_it')) {
function log_it($message)
{
if (WP_DEBUG === true) {
if (is_array($message) || is_object($message)) {
error_log(print_r($message, true));
} else {
error_log($message);
}
}
}
}
// wp config options
// debug stuff for plugin dev
@ini_set('display_errors',0);
define( 'WP_DEBUG', true ); // Turn debugging ON
define( 'WP_DEBUG_DISPLAY', false ); // Turn forced display OFF
define( 'WP_DEBUG_LOG', true ); // Turn logging to wp-content/debug.log ON
define( 'WP_POST_REVISIONS', false); // Disables revision functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment