blob: 78dfe595e63966c808e89a51f0ea843012246b18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
<?php
/**
* This is the base class for every Core API endpoint that needs an XMLRPC client.
*
*/
abstract class Jetpack_Core_API_XMLRPC_Consumer_Endpoint {
/**
* An instance of the Jetpack XMLRPC client to make WordPress.com requests
*
* @private
* @var Jetpack_IXR_Client
*/
protected $xmlrpc;
/**
* @param Jetpack_IXR_Client $xmlrpc
*/
public function __construct( $xmlrpc ) {
$this->xmlrpc = $xmlrpc;
}
/**
* Checks if the site is public and returns the result.
* @return Boolean $is_public
*/
protected function is_site_public() {
if ( $this->xmlrpc->query( 'jetpack.isSitePubliclyAccessible', home_url() ) ) {
return $this->xmlrpc->getResponse();
}
return false;
}
}
|