woocommerce_get_cancel_order_url
Generates a URL so that a customer can cancel their (unpaid - pending) order.
Использование
add_filter( 'woocommerce_get_cancel_order_url', 'wp_kama_woocommerce_get_cancel_order_url_filter' ); /** * Function for `woocommerce_get_cancel_order_url` filter-hook. * * @param string $redirect Redirect URL. * * @return string */ function wp_kama_woocommerce_get_cancel_order_url_filter( $redirect ){ // filter... return $redirect; }
- $redirect(строка)
- Redirect URL.
Где вызывается хук
woocommerce_get_cancel_order_url
woocommerce/includes/class-wc-order.php 1779-1793
return apply_filters( 'woocommerce_get_cancel_order_url', wp_nonce_url( add_query_arg( array( 'cancel_order' => 'true', 'order' => $this->get_order_key(), 'order_id' => $this->get_id(), 'redirect' => $redirect, ), $this->get_cancel_endpoint() ), 'woocommerce-cancel_order' ) );