1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Jetpack Client |
4
|
|
|
* |
5
|
|
|
* Deprecated methods for Jetpack to act as client with wpcom, provided for back-compatibility. |
6
|
|
|
* |
7
|
|
|
* @category Connection |
8
|
|
|
* @package Client |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
use Automattic\Jetpack\Connection\Client; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* Class Jetpack_Client |
15
|
|
|
* |
16
|
|
|
* @deprecated Use Automattic\Jetpack\Connection\Client |
17
|
|
|
*/ |
18
|
|
|
class Jetpack_Client { |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Perform remote request. |
22
|
|
|
* |
23
|
|
|
* @deprecated use Automattic\Jetpack\Connection\Client::remote_request |
24
|
|
|
* |
25
|
|
|
* @param array $args Arguments. |
26
|
|
|
* @param null $body Request body. |
27
|
|
|
* |
28
|
|
|
* @return array|WP_Error |
29
|
|
|
*/ |
30
|
|
|
public static function remote_request( $args, $body = null ) { |
31
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Connection\Client' ); |
32
|
|
|
return Client::remote_request( $args, $body ); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Request to wpcom using the blog id. |
37
|
|
|
* |
38
|
|
|
* @deprecated use Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_blog |
39
|
|
|
* |
40
|
|
|
* @param string $path Endpoint path. |
41
|
|
|
* @param string $version Endpoint version. |
42
|
|
|
* @param array $args Arguments. |
43
|
|
|
* @param null $body Request body. |
44
|
|
|
* @param string $base_api_path Endpoint base prefix. |
45
|
|
|
* |
46
|
|
|
* @return Array|WP_Error |
47
|
|
|
*/ |
48
|
|
|
public static function wpcom_json_api_request_as_blog( $path, $version, $args, $body, $base_api_path ) { |
49
|
|
|
_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\Jetpack\Connection\Client' ); |
50
|
|
|
return Client::wpcom_json_api_request_as_blog( $path, $version, $args, $body, $base_api_path ); |
51
|
|
|
} |
52
|
|
|
} |
53
|
|
|
|