WC_Order::get_cancel_order_url()publicWC 1.0

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

{} Это метод класса: WC_Order{}

Хуки из метода

Возвращает

Строку.

Использование

$WC_Order = new WC_Order();
$WC_Order->get_cancel_order_url( $redirect );
$redirect(строка)
Redirect URL.
По умолчанию: ''

Код WC_Order::get_cancel_order_url() WC 6.4.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'
		)
	);
}