woocommerce_get_cancel_order_url_raw
Filter the raw URL to cancel the order in the frontend.
Usage
add_filter( 'woocommerce_get_cancel_order_url_raw', 'wp_kama_woocommerce_get_cancel_order_url_raw_filter', 10, 3 );
/**
* Function for `woocommerce_get_cancel_order_url_raw` filter-hook.
*
* @param string $url
* @param WC_Order $order Order data.
* @param string $redirect Redirect URL.
*
* @return string
*/
function wp_kama_woocommerce_get_cancel_order_url_raw_filter( $url, $order, $redirect ){
// filter...
return $url;
}
- $url(string)
- -
- $order(WC_Order)
- Order data.
- $redirect(string)
- Redirect URL.
Changelog
| Since 2.2.0 | Introduced. |
Where the hook is called
woocommerce_get_cancel_order_url_raw
woocommerce/includes/class-wc-order.php 1997-2011
return apply_filters( 'woocommerce_get_cancel_order_url_raw', add_query_arg( array( 'cancel_order' => 'true', 'order' => $this->get_order_key(), 'order_id' => $this->get_id(), 'redirect' => $redirect, '_wpnonce' => wp_create_nonce( 'woocommerce-cancel_order' ), ), $this->get_cancel_endpoint() ), $this, $redirect );