Import legacy nurinda.co.id website
This commit is contained in:
1 parent
3f59bb9038
commit
6e21646ac4
13389 files changed
+3246690
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* Write some variable value to debug file, when it's hard to output it directly
|
||||
*
|
||||
* @param $value
|
||||
* @param bool|FALSE $with_backtrace
|
||||
*/
|
||||
function us_write_debug( $value, $with_backtrace = FALSE ) {
|
||||
global $us_template_directory;
|
||||
static $first = TRUE;
|
||||
$data = '';
|
||||
if ( $with_backtrace ) {
|
||||
$backtrace = debug_backtrace();
|
||||
array_shift( $backtrace );
|
||||
$data .= print_r( $backtrace, TRUE ) . ":\n";
|
||||
}
|
||||
ob_start();
|
||||
var_dump( $value );
|
||||
$data .= ob_get_clean() . "\n\n";
|
||||
file_put_contents( $us_template_directory . '/debug.txt', $data, $first ? NULL : FILE_APPEND );
|
||||
$first = FALSE;
|
||||
}
|
||||
Reference in new issue
Block a user