public function build_api_url() {

		$url = parse_url( $this->store_url );

		// default to http if not provided
		$scheme = isset( $url['scheme'] ) ? $url['scheme'] : 'http';

		// set host
		$host = $url['host'];

		// add port to host if provided
		$host .= isset( $url['port'] ) ? ':' . $url['port'] : '';

		// set path and strip any trailing slashes
		$path = isset( $url['path'] ) ? rtrim( $url['path'], '/' ) : '';

		// add WC API path
		$path .= '/wc-api/v2/';

		// build URL
		$this->api_url = "{$scheme}://{$host}{$path}";
	}
public function build_api_url() {

		$url = parse_url( $this->store_url );

		// default to http if not provided
		$scheme = isset( $url['scheme'] ) ? $url['scheme'] : 'http';

		// set host
		$host = $url['host'];

		// add port to host if provided
		$host .= isset( $url['port'] ) ? ':' . $url['port'] : '';

		// set path and strip any trailing slashes
		$path = isset( $url['path'] ) ? rtrim( $url['path'], '/' ) : '';

		// add WC API path
		$path .= '/wc-api/v2/';

		// build URL
		$this->api_url = "{$scheme}://{$host}{$path}";
	}
public function build_api_url ( ) { $ url = parse_url ( $ this -> store_url ) ; // default to http if not provided $ scheme = isset ( $ url [ 'scheme' ] ) ? $ url [ 'scheme' ] : 'http' ; // set host $ host = $ url [ 'host' ] ; // add port to host if provided $ host .= isset ( $ url [ 'port' ] ) ? ':' . $ url [ 'port' ] : '' ; // set path and strip any trailing slashes $ path = isset ( $ url [ 'path' ] ) ? rtrim ( $ url [ 'path' ] , '/' ) : '' ; // add WC API path $ path .= '/wc-api/v2/' ; // build URL $ this -> api_url = "{$scheme}://{$host}{$path}" ; }
Build the correct API URL given the store URL provided

@since 2.0
Build the correct API URL given the store URL provided