WC_Auth::build_url
Build auth urls.
Method of the class: WC_Auth{}
No Hooks.
Returns
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. |
WC_Auth::build_url() WC Auth::build url code WC 10.7.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
);
}