WordPress at Your Fingertips
function is not described

WooCommerce::api_request_url() public WC 1.0

Return the WC API URL for a given request.

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

Hooks from the method
Return

String.

Usage

$WooCommerce = new WooCommerce();
$WooCommerce->api_request_url( $request, $ssl );
$request(string) (required)
Requested endpoint.
$ssl(true|false|null)
If should use SSL, null if should auto detect.
Default: null

Code of WooCommerce::api_request_url() WC 5.7.1

public function api_request_url( $request, $ssl = null ) {
	if ( is_null( $ssl ) ) {
		$scheme = wp_parse_url( home_url(), PHP_URL_SCHEME );
	} elseif ( $ssl ) {
		$scheme = 'https';
	} else {
		$scheme = 'http';
	}

	if ( strstr( get_option( 'permalink_structure' ), '/index.php/' ) ) {
		$api_request_url = trailingslashit( home_url( '/index.php/wc-api/' . $request, $scheme ) );
	} elseif ( get_option( 'permalink_structure' ) ) {
		$api_request_url = trailingslashit( home_url( '/wc-api/' . $request, $scheme ) );
	} else {
		$api_request_url = add_query_arg( 'wc-api', $request, trailingslashit( home_url( '', $scheme ) ) );
	}

	return esc_url_raw( apply_filters( 'woocommerce_api_request_url', $api_request_url, $request, $ssl ) );
}