daily pastebin goal
83%
SHARE
TWEET

WordPress - Write variables to the debug log

lorro Jul 27th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. </php
  2. // WordPress - Write variables to the debug log
  3. function write_log ( $log )  {
  4.   if ( is_array( $log ) || is_object( $log ) ) {
  5.     error_log( print_r( $log, true ) );
  6.   } else {
  7.     error_log( $log );
  8.   }
  9. }
  10.  
  11. // Usage
  12. function my_new_function_that_doesnt_work( $value ) {
  13.   write_log( $value );
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top