Posted By

florent on 10/21/11


Tagged

debug wordpress


Versions (?)

Know what’s going on with debug() function


 / Published in: PHP
 

  1.  
  2.  
  3.  
  4.  
  5. To make things even easier, I put this inside one function in my functions.php so it helps me a lot:
  6. 1 <?php
  7. 2 function debug($var) {
  8. 3 if ( ! is_string($var) ) {
  9. 4 echo "<pre>";
  10. 5 print_r($var);
  11. 6 echo "</pre>";
  12. 7 } else {
  13. 8 echo "DEBUG: ".$var;
  14. 9 }
  15. 10 }
  16. 11 ?>

Report this snippet  

You need to login to post a comment.