Свойство | Тип | Описание | |
---|---|---|---|
$json_desc | |||
$response | |||
$response_code |
Свойство | Тип | Описание | |
---|---|---|---|
$access_token | |||
$access_token_secret | |||
$api_url | |||
$autoredirect_authoriziation | |||
$callback_uri | |||
$client_key | |||
$client_secret | |||
$endpoint_url | |||
$headers | |||
$is_authorizing | |||
$key | |||
$method | |||
$server | OAuth1 Client | ||
$store | WDS_WP_REST_API\Storage\Store_Interface | Options Store | |
$transient | WDS_WP_REST_API\Storage\Transient_Interface | Transients Store |
Метод | Описание | |
---|---|---|
__construct ( array $storage_classes = [] ) | Connect object constructor. | |
__get ( string $field ) : mixed | Magic getter for our object. | |
api_url ( string $path = '' ) : string | Get the api_url and append included path | |
args ( ) : array | Get current object data for debugging. | |
auth_delete_request ( string $path, $data = [] ) : object | WP_Erro\WP_Error | Perform an authenticated DELETE request | |
auth_get_request ( string $path, array $data = [] ) : object | WP_Erro\WP_Error | Perform an authenticated GET request | |
auth_head_request ( string $path, array $data = [] ) : object | WP_Erro\WP_Error | Perform an authenticated HEAD request | |
auth_post_request ( string $path, array $data = [] ) : object | WP_Erro\WP_Error | Perform an authenticated POST request | |
auth_request ( string $path, array $request_args = [], string $method = 'GET' ) : object | WP_Erro\WP_Error | Perform an authenticated request | |
cache_api_description_for_api_url ( ) : mixed | Fetches and caches the API Description object | |
connected ( ) : boolean | Tests whether connection has been created. | |
delete_option ( $option = '' ) : boolean | Handles deleting the stored data for a connection | |
delete_stored_error ( ) : mixed | Fetches the wp_rest_api_connect_error option value | |
discovered ( ) : boolean | Tests whether API discovery has been completed. | |
do_authorization ( string $oauth_token, string $oauth_verifier ) : mixed | Swap temporary credentials for permanent authorized credentials. | |
do_discovery ( string $url = '' ) : string | WP_Erro\WP_Error | Do the API discovery. | |
get_api_description ( ) : object | Retrieves the API Description object | |
get_authorization_url ( ) : string | WP_Erro\WP_Error | Get the authorization (login) URL for the server. | |
get_json_if_json ( string $body ) : mixed | Determines if a string is JSON, and if so, decodes it and returns it. Else returns unchanged body object. | |
get_option ( string $option = 'all' ) : mixed | Retrieve stored option | |
get_requested_url ( ) : string | Get the current URL | |
get_server ( ) : |
Get WPServer object | |
get_stored_error ( ) : mixed | Fetches the wp_rest_api_connect_error option value. | |
get_stored_error_message ( ) : string | Fetches the wp_rest_api_connect_error message. | |
get_stored_error_request_args ( ) : string | Fetches the wp_rest_api_connect_error request_args. | |
get_stored_error_request_response ( ) : string | Fetches the wp_rest_api_connect_error request_response. | |
get_user ( ) : mixed | Get's authorized user. Useful for testing authenticated connection. | |
init ( array $args ) | Initate our connect object | |
is_authorizing ( ) : boolean | Check if the authorization callback has been initiated. | |
is_json ( string $string ) : boolean | array | Determines if a string is JSON, and if so, decodes it. | |
key ( ) : string | Get the stored-data key | |
maybe_redirect_to_authorization ( ) : boolean | WP_Erro\WP_Error | If autoredirect is enabled, and we are not yet authorized, redirect to the server to get authorization. | |
redirect_to_login ( ) : mixed | Do the redirect to the authorization (login) URL. | |
request_access_url ( ) : mixed | Gets the access URL from the JSON description object | |
request_authorize_url ( ) : mixed | Gets the authorization base URL from the JSON description object | |
request_token_url ( ) : mixed | Gets the request URL from the JSON description object | |
reset_connection ( ) | Deletes all stored data for this connection. | |
set_api_url ( string $value ) | Sets the api_url object property | |
set_callback_uri ( string $value ) | Sets the callback_uri object property | |
set_client_key ( string $value ) | Sets the client_key object property | |
set_client_secret ( string $value ) | Sets the client_secret object property | |
set_endpoint_url ( string $value ) | Sets the endpoint_url object property | |
set_headers ( $headers ) | Sets the headers object property | |
set_method ( string $method ) : string | Set request method | |
set_object_properties ( ) | Get the options from the DB and set the object properties. | |
update_option ( string $option, mixed $value, boolean $set = true ) : Original | Update the options array | |
update_stored_error ( string $error = '' ) : void | Updates/replaces the wp_rest_api_connect_error option. |
Метод | Описание | |
---|---|---|
instantiate_storage_objects ( WDS_WP_REST_API\Storage\Store_Interface $store, WDS_WP_REST_API\Storage\Store_Interface $error_store, WDS_WP_REST_API\Storage\Transient_Interface $transient ) | Instantiates the storage objects for the options and transients. |
public __construct ( array $storage_classes = [] ) | ||
$storage_classes | array | (optional) override the storage classes. |
public auth_delete_request ( string $path, $data = [] ) : object | WP_Erro\WP_Error | ||
$path | string | Url endpoint path to resource |
Результат | object | WP_Erro\WP_Error | Updated object, or WP_Error |
public auth_request ( string $path, array $request_args = [], string $method = 'GET' ) : object | WP_Erro\WP_Error | ||
$path | string | Url endpoint path to resource |
$request_args | array | Array of data to send in request. |
$method | string | Request method. Defaults to GET |
Результат | object | WP_Erro\WP_Error | Updated object, or WP_Error |
public cache_api_description_for_api_url ( ) : mixed | ||
Результат | mixed | Description object for api_url |
public delete_option ( $option = '' ) : boolean | ||
Результат | boolean | Result of delete_option |
public delete_stored_error ( ) : mixed | ||
Результат | mixed | wp_rest_api_connect_error option value |
public discovered ( ) : boolean | ||
Результат | boolean |
public do_discovery ( string $url = '' ) : string | WP_Erro\WP_Error | ||
$url | string | The URL to discover. |
Результат | string | WP_Erro\WP_Error | The API endpoint URL or WP_Error. |
public get_api_description ( ) : object | ||
Результат | object | Description object for api_url |
public get_authorization_url ( ) : string | WP_Erro\WP_Error | ||
Результат | string | WP_Erro\WP_Error | Authorization URL or WP_Error. |
public get_json_if_json ( string $body ) : mixed | ||
$body | string | HTTP retrieved body |
Результат | mixed | Decoded JSON object or unchanged body |
public get_option ( string $option = 'all' ) : mixed | ||
$option | string | Option array key |
Результат | mixed | Value of option requested |
public get_requested_url ( ) : string | ||
Результат | string | current URL |
public get_server ( ) : |
||
Результат |
public get_stored_error ( ) : mixed | ||
Результат | mixed | wp_rest_api_connect_error option value. |
public get_stored_error_message ( ) : string | ||
Результат | string | Stored error message value. |
public get_stored_error_request_args ( ) : string | ||
Результат | string | Stored error request_args value. |
public get_stored_error_request_response ( ) : string | ||
Результат | string | Stored error request_response value. |
protected instantiate_storage_objects ( WDS_WP_REST_API\Storage\Store_Interface $store, WDS_WP_REST_API\Storage\Store_Interface $error_store, WDS_WP_REST_API\Storage\Transient_Interface $transient ) | ||
$store | WDS_WP_REST_API\Storage\Store_Interface | Option storage |
$error_store | WDS_WP_REST_API\Storage\Store_Interface | Error option storage |
$transient | WDS_WP_REST_API\Storage\Transient_Interface | Transient storage |
public is_authorizing ( ) : boolean | ||
Результат | boolean |
public maybe_redirect_to_authorization ( ) : boolean | WP_Erro\WP_Error | ||
Результат | boolean | WP_Erro\WP_Error | WP_Error is an issue, else redirects. |
public redirect_to_login ( ) : mixed | ||
Результат | mixed | WP_Error if authorization URL lookup fails. |
public request_access_url ( ) : mixed | ||
Результат | mixed | Access URL or error |
public request_authorize_url ( ) : mixed | ||
Результат | mixed | Authorization URL or error |
public request_token_url ( ) : mixed | ||
Результат | mixed | Request URL or error |
public reset_connection ( ) |
public set_api_url ( string $value ) | ||
$value | string | Value to set |
public set_callback_uri ( string $value ) | ||
$value | string | Value to set |
public set_client_key ( string $value ) | ||
$value | string | Value to set |
public set_client_secret ( string $value ) | ||
$value | string | Value to set |
public set_endpoint_url ( string $value ) | ||
$value | string | Value to set |
public set_method ( string $method ) : string | ||
$method | string | Request method |
Результат | string | New request method |
public set_object_properties ( ) |
public update_stored_error ( string $error = '' ) : void | ||
$error | string | Error message |
Результат | void |
protected WPServer,WDS_WP_REST_API\OAuth1 $server | ||
Результат |
protected Store_Interface,WDS_WP_REST_API\Storage $store | ||
Результат | WDS_WP_REST_API\Storage\Store_Interface |