Skip to content

Instantly share code, notes, and snippets.

@cheh
Last active January 1, 2016 10:29
Show Gist options
  • Save cheh/8132005 to your computer and use it in GitHub Desktop.
Save cheh/8132005 to your computer and use it in GitHub Desktop.
WP: Debugging
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'SAVEQUERIES', true );
define( 'SCRIPT_DEBUG', true );
//define( 'DISABLE_WP_CRON', true );
define( 'CONCATENATE_SCRIPTS', false );
// Write to the log file.
error_log( var_export( $foo, true ) );
// Prints debug info.
function out( $what ) {
$bt = debug_backtrace();
echo '<br><br>' . $bt[0]['file'] . '[' . $bt[0]['line'] . ']: <br><pre>' . print_r( $what, true ) . '</pre><br>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment