Automattic\WooCommerce\Internal\OrderWithdrawal

OrderWithdrawalEndpoint::get_url │ public │ WC 11.3.0

Get the configured public order withdrawal page URL.

Method of the class: OrderWithdrawalEndpoint{}

No Hooks.

Returns

null. Nothing (null).

Usage

$OrderWithdrawalEndpoint = new OrderWithdrawalEndpoint();
$OrderWithdrawalEndpoint->get_url(): string;

Changelog

Since 11.3.0 Introduced.

OrderWithdrawalEndpoint::get_url() code WC 11.3.0

public function get_url(): string {
	$account_url = wc_get_page_permalink( 'myaccount' );
	$query_vars  = WC()->query->get_query_vars();
	$endpoint    = ! empty( $query_vars[ self::ENDPOINT_KEY ] ) ? self::ENDPOINT_KEY : $this->get_slug();

	return wc_get_endpoint_url( $endpoint, '', $account_url ? $account_url : home_url( '/' ) );
}