WC_Order::get_cancel_order_url_raw( string $redirect = '' )

Generates a raw (unescaped) cancel-order URL for use by payment gateways.


Description Description


Parameters Parameters

$redirect

(Optional) Redirect URL.

Default value: ''


Top ↑

Return Return

(string) The unescaped cancel-order URL.


Top ↑

Source Source

File: includes/class-wc-order.php

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


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.