title: Wordpress print_r or echo from within hook callback
body: <p>I want to debug a function below. The print_r nor echo are not displaying anything though.  How can I print the contents of:
  $order or $paypal_args ? </p>
  
  <pre><code>function custom_override_paypal_email1( $paypal_args, $order ) {
      print_r($paypal_args);
      print_r($order);
      // die();
      global $woocommerce;
  
      foreach ( $order-&gt;get_items() as $product ) {
              $terms = get_the_terms($product['product_id'],'product_cat');
              if (!is_null($terms)){
                      if(count($terms)&gt;0)
                      {
                          //get first one
                      $term = $terms[0];
  
                   if(strtolower($catName)==='ethics'){
                           $paypal_args['business'] = "zzz@zzz.example.com";
                       }
                       else{
                          // $t = strval($term);
                          $paypal_args['business'] = $t ."yyy@yyy.example.com";
                       }
                  }
              }
          //  break;
          }
  //      $woocommerce-&gt;add_error( sprintf( "You must add a minimum of %s %s's to your cart to proceed." , 1, "T" ) );
      return $paypal_args;
  }
  add_filter( 'woocommerce_paypal_args' , 'custom_override_paypal_email1', 10, 2  ); 
  </code></pre>
  
  <p>Whenever I run the function I am getting the following woocommerce notice:</p>
  
  <pre><code>SyntaxError: Unexpected token m in JSON at position 0
  </code></pre>