Properties

$log_requests

$log_requests : bool|mixed|void

Type

normal

$pretty_print

$pretty_print : bool|int|null

Type

normal

$is_valid_request

$is_valid_request : bool

Type

normal

$user_id

$user_id : int

Type

normal

$stats

$stats

$data

$data : array

Type

normal

$override

$override : bool

Type

normal

$vars

$vars : array

Type

normal

Methods

__construct()

__construct() : mixed

REST_API constructor.

Returns

mixed

add_endpoint()

add_endpoint( $rewrite_rules) : mixed

Registers a new rewrite endpoint for accessing the API

Parameters

$rewrite_rules

Returns

mixed

process_query()

process_query() : mixed

Listens for the API and then processes the API requests

Returns

mixed

get_user()

get_user(string  $key = '') : bool

Retrieve the user ID based on the public key provided

Parameters

string $key

Returns

bool

get_stats()

get_stats( $args) : array

Get some stats

Parameters

$args

Returns

array

get_users()

get_users( $args) : array

Process Get users API Request

Parameters

$args

Returns

array

update_user()

update_user( $args) : array

Update user API query

Parameters

$args

Returns

array

delete_user()

delete_user( $args) : array

Process delete user via API

Parameters

$args

Returns

array

get_auser()

get_auser( $args) : array

Process Get user API Request

Parameters

$args

Returns

array

get_query_mode()

get_query_mode() : null

Determines the kind of query requested and also ensure it is a valid query

Returns

null

get_paged()

get_paged() : mixed

Get page number

Returns

mixed

get_output_format()

get_output_format() : mixed

Retrieve the output format

Returns

mixed

get_output()

get_output() : mixed

Retrieve the output data

Returns

mixed

output()

output(int  $status_code = 200) : mixed

Output Query in either JSON/XML. The query data is outputted as JSON by default

Parameters

int $status_code

Returns

mixed

validate_request()

validate_request() : mixed

Validate the API request

Returns

mixed

missing_auth()

missing_auth() : mixed

Displays a missing authentication error if all the parameters aren't provided

Returns

mixed

invalid_auth()

invalid_auth() : mixed

Displays an authentication failed error if the user failed to provide valid credentials

Returns

mixed

invalid_key()

invalid_key() : mixed

Displays an invalid API key error if the API key provided couldn't be validated

Returns

mixed

getsrc()

getsrc( $image) : string

Get source

Parameters

$image

Returns

string

log_request()

log_request(array  $data = array()) : mixed

Log each API request, if enabled

Parameters

array $data

Returns

mixed