There was an error while loading. Please reload this page.
You can use special debug functions wp_dump() and wlog() to debug your code.
wp_dump()
wlog()
Supports a variable number of arguments
wp_dump( ...$params );
for example:
wp_dump($a, $b, $c);
will display value of all variables in a convenient way with <pre></pre>
<pre></pre>
array(3) { [0]=> string(3) "var $a value" [1]=> string(3) "var $b value" [2]=> string(3) "var $c value" }
Writes data to w.log file, that appears in path get_stylesheet_directory() . '/w.log';
w.log
get_stylesheet_directory() . '/w.log';
wlog( $var, $desc = ' >> ', $clear_log = false );
You can use it with any type of data. For example:
wlog( ['some string', 55, ['some array with data']], '>> My debug note' );
will add to w.log:
[14:11:09]------------------------- [14:11:09]>> My debug note : Array ( [0] => some string [1] => 55 [2] => Array ( [0] => some array with data ) )