WordPress at Your Fingertips
function is not described

WC_Order::get_cancel_order_url() public WC 1.0

Generates a URL so that a customer can cancel their (unpaid - pending) order.

{} It's a method of the class: WC_Order{}

Hooks from the method
Return

String.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_cancel_order_url( $redirect );
$redirect(string)
Redirect URL.
Default: ''

Code of WC_Order::get_cancel_order_url() WC 5.7.1

public function get_cancel_order_url( $redirect = '' ) {
	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'
		)
	);
}