Created
August 16, 2024 08:01
-
-
Save mainiomooses/4b4a13b08f4539ee128e9c9db3667f11 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Debug helper, place near the top of your functions.php | |
* Use with write_log($var) to write $var contents into debug.log | |
*/ | |
function write_log( $data ) { | |
if ( true === WP_DEBUG ) { | |
if ( is_array( $data ) || is_object( $data ) ) { | |
error_log( print_r( $data, true ) ); | |
} else { | |
error_log( $data ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment