title: WooCommerce action hook to redirect to new page on order failed
body: <p>I want to redirect to a custom wordpress page if a customers woocommerce order fails.</p>
  
  <p>I have found and implemented the following code which redirects to a new page upon payment success. </p>
  
  <p>Is it possible to add to this code, so a failed order is sent to another specific url ?</p>
  
  <pre class="lang-php prettyprint-override"><code>add_action( 'woocommerce_thankyou', 'bbloomer_redirectcustom');
  
  function bbloomer_redirectcustom( $order_id ){
      $order = wc_get_order( $order_id );
      $url = 'https://yoursite.com/custom-url';
      if ( ! $order-&gt;has_status( 'failed' ) ) {
          wp_safe_redirect( $url );
          exit;
      }
  }
  </code></pre>