Advertisement
lorro

WordPress - Write variables to the debug log

Jul 27th, 2018
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement