WordPress at Your Fingertips
function is not described

WC_Auth::build_url() protected WC 2.4.0

Build auth urls.

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

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->build_url( $data, $endpoint );
$data(array) (required)
Data to build URL.
$endpoint(string) (required)
Endpoint.

Changelog

Since 2.4.0 Introduced.

Code of WC_Auth::build_url() WC 5.8.0

protected function build_url( $data, $endpoint ) {
	$url = wc_get_endpoint_url( 'wc-auth/v' . self::VERSION, $endpoint, home_url( '/' ) );

	return add_query_arg(
		array(
			'app_name'     => wc_clean( $data['app_name'] ),
			'user_id'      => wc_clean( $data['user_id'] ),
			'return_url'   => rawurlencode( $this->get_formatted_url( $data['return_url'] ) ),
			'callback_url' => rawurlencode( $this->get_formatted_url( $data['callback_url'] ) ),
			'scope'        => wc_clean( $data['scope'] ),
		), $url
	);
}