Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ################################################################################################################
- # #
- # Add the snippet below in the file wp-config.php right above: /* That's all, stop editing! Happy blogging. */ #
- # It will write the error.log right into the wp-content-folder. #
- # #
- # You can also use something like this to var_dump to your error log: #
- # idWriteLog( $myVar, 'varName' ); #
- # idWriteLog( myFunc(), 'funcName' ); #
- # #
- # it is especially useful to var_dump ajax requests #
- # #
- ################################################################################################################
- define('WP_DEBUG', true );
- if ( WP_DEBUG )
- {
- // Save Queries inside database and that array can be displayed to help analyze
- define('SAVEQUERIES', true );
- // Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
- define('SCRIPT_DEBUG', true );
- // debug.log to wp-content
- define( 'WP_DEBUG_LOG', true );
- define( 'WP_DEBUG_DISPLAY', false );
- if ( ! function_exists( 'idWriteLog' ) )
- {
- function idWriteLog( $log, $name = false )
- {
- $separator1 = '';
- for ( $i = 0; $i <= 53; $i++ ){ $separator1 .= '#'; }
- ob_start();
- echo '---***--- Custom var_dump: ---***---' . "\r\n\r\n";
- echo '### Start' . $separator1 . "\r\n\r\n";
- if ( function_exists( 'current_filter' ) )
- {
- echo 'Current Filter: ' . current_filter();
- echo "\r\n\r\n";
- } // end if
- echo 'Output: ' . ( $name ? $name : '' );
- echo "\r\n\r\n";
- var_dump( $log );
- echo "\r\n";
- echo '### End '. $separator1 . "\r\n\r\n";
- $result = ob_get_clean();
- error_log( $result );
- } // end idWriteLog
- } // end if
- } // end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement