PHP Класс Jetpack_Client, jetpack

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
_stringify_data ( array | mixed $data ) : array | string Takes an array or similar structure and recursively turns all values into strings. This is used to make sure that body hashes are made ith the string version, which is what will be seen after a server pulls up the data in the $_POST array.
_wp_remote_request ( $url, $args, $set_fallback = false ) : array | WP_Error Wrapper for wp_remote_request(). Turns off SSL verification for certain SSL errors.
remote_request ( $args, $body = null ) : array | WP_Error Makes an authorized remote request using Jetpack_Signature
set_time_diff ( &$response, $force_set = false )
wpcom_json_api_request_as_blog ( string $path, string $version = self::WPCOM_JSON_API_VERSION, array $args = [], string $body = null ) : array | WP_Error Query the WordPress.com REST API using the blog token

Описание методов

_stringify_data() публичный статический Метод

Takes an array or similar structure and recursively turns all values into strings. This is used to make sure that body hashes are made ith the string version, which is what will be seen after a server pulls up the data in the $_POST array.
public static _stringify_data ( array | mixed $data ) : array | string
$data array | mixed
Результат array | string

_wp_remote_request() публичный статический Метод

This is lame, but many, many, many hosts have misconfigured SSL. When Jetpack is registered, the jetpack_fallback_no_verify_ssl_certs option is set to the current time if: 1. a certificate error is found AND 2. not verifying the certificate works around the problem. The option is checked on each request.
См. также: Jetpack::fix_url_for_bad_hosts()
public static _wp_remote_request ( $url, $args, $set_fallback = false ) : array | WP_Error
Результат array | WP_Error WP HTTP response on success

remote_request() публичный статический Метод

Makes an authorized remote request using Jetpack_Signature
public static remote_request ( $args, $body = null ) : array | WP_Error
Результат array | WP_Error WP HTTP response on success

set_time_diff() публичный статический Метод

public static set_time_diff ( &$response, $force_set = false )

wpcom_json_api_request_as_blog() статический публичный Метод

Query the WordPress.com REST API using the blog token
static public wpcom_json_api_request_as_blog ( string $path, string $version = self::WPCOM_JSON_API_VERSION, array $args = [], string $body = null ) : array | WP_Error
$path string
$version string
$args array
$body string
Результат array | WP_Error $response Data.