WC_Order::get_cancel_endpoint()
Helper method to return the cancel endpoint.
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();
WC_Order::get_cancel_endpoint() WC Order::get cancel endpoint code WC 9.6.1
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; }