WooCommerce Code Reference

WC_Auth
in package

Auth class.

Table of Contents

VERSION  = 1
Version.
__construct()  : mixed
Setup class.
add_endpoint()  : mixed
Add auth endpoint.
add_query_vars()  : array<string|int, string>
Add query vars.
handle_auth_requests()  : mixed
Handle auth requests.
auth_endpoint()  : mixed
Auth endpoint.
build_url()  : string
Build auth urls.
create_keys()  : array<string|int, mixed>
Create keys.
get_formatted_url()  : string
Decode and format a URL.
get_i18n_scope()  : string
Get scope name.
get_permissions_in_scope()  : array<string|int, mixed>
Return a list of permissions a scope allows.
make_validation()  : mixed
Make validation.
post_consumer_data()  : bool
Post consumer data.
maybe_delete_key()  : mixed
Maybe delete key.

Constants

Methods

__construct()

Setup class.

public __construct() : mixed
Tags
since
2.4.0
Return values
mixed

add_endpoint()

Add auth endpoint.

public static add_endpoint() : mixed
Tags
since
2.4.0
Return values
mixed

add_query_vars()

Add query vars.

public add_query_vars(array<string|int, mixed> $vars) : array<string|int, string>
Parameters
$vars : array<string|int, mixed>

Query variables.

Tags
since
2.4.0
Return values
array<string|int, string>

handle_auth_requests()

Handle auth requests.

public handle_auth_requests() : mixed
Tags
since
2.4.0
throws
Exception

When auth_endpoint validation fails.

Return values
mixed

auth_endpoint()

Auth endpoint.

protected auth_endpoint(string $route) : mixed
Parameters
$route : string

Route.

Tags
since
2.4.0
throws
Exception

When validation fails.

Return values
mixed

build_url()

Build auth urls.

protected build_url(array<string|int, mixed> $data, string $endpoint) : string
Parameters
$data : array<string|int, mixed>

Data to build URL.

$endpoint : string

Endpoint.

Tags
since
2.4.0
Return values
string

create_keys()

Create keys.

protected create_keys(string $app_name, string $app_user_id, string $scope) : array<string|int, mixed>
Parameters
$app_name : string

App name.

$app_user_id : string

User ID.

$scope : string

Scope.

Tags
since
2.4.0
Return values
array<string|int, mixed>

get_formatted_url()

Decode and format a URL.

protected get_formatted_url(string $url) : string
Parameters
$url : string

URL.

Return values
string

get_i18n_scope()

Get scope name.

protected get_i18n_scope(string $scope) : string
Parameters
$scope : string

Permission scope.

Tags
since
2.4.0
Return values
string

get_permissions_in_scope()

Return a list of permissions a scope allows.

protected get_permissions_in_scope(string $scope) : array<string|int, mixed>
Parameters
$scope : string

Permission scope.

Tags
since
2.4.0
Return values
array<string|int, mixed>

make_validation()

Make validation.

protected make_validation() : mixed
Tags
since
2.4.0
throws
Exception

When validate fails.

Return values
mixed

post_consumer_data()

Post consumer data.

protected post_consumer_data(array<string|int, mixed> $consumer_data, string $url) : bool
Parameters
$consumer_data : array<string|int, mixed>

Consumer data.

$url : string

URL.

Tags
since
2.4.0
throws
Exception

When validation fails.

Return values
bool

maybe_delete_key()

Maybe delete key.

private maybe_delete_key(array<string|int, mixed> $key) : mixed
Parameters
$key : array<string|int, mixed>

Key.

Tags
since
2.4.0
Return values
mixed