WordPress at Your Fingertips
function is not described

WC_Order::get_cancel_endpoint() public WC 1.0

Helper method to return the cancel endpoint.

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

No Hooks.

Return

String. the cancel endpoint; either the cart page or the home page.

Usage

$WC_Order = new WC_Order();
$WC_Order->get_cancel_endpoint();

Code of WC_Order::get_cancel_endpoint() WC 5.8.0

public function get_cancel_endpoint() {
	$cancel_endpoint = wc_get_cart_url();
	if ( ! $cancel_endpoint ) {
		$cancel_endpoint = home_url();
	}

	if ( false === strpos( $cancel_endpoint, '?' ) ) {
		$cancel_endpoint = trailingslashit( $cancel_endpoint );
	}

	return $cancel_endpoint;
}