Skip to content

Instantly share code, notes, and snippets.

@cobbman
Created September 10, 2013 18:51
Show Gist options
  • Save cobbman/6513873 to your computer and use it in GitHub Desktop.
Save cobbman/6513873 to your computer and use it in GitHub Desktop.
Print WordPress errors to the error log
/*
Log Me - Debug Function
@param {string} $message Message that you would like to pass to the debug.log file.
*/
function post_debug( $message ) {
if ( WP_DEBUG === true ) {
if ( is_array( $message ) || is_object( $message ) ) {
error_log( print_r( $message, true ) );
} else {
error_log( $message );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment