PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 12.7
Jetpack – WP Security, Backup, Speed, & Growth v12.7
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / sal / class.json-api-platform.php

class.json-api-platform.php in Jetpack – WP Security, Backup, Speed, & Growth 12.7, at sal/class.json-api-platform.php

50 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 /**
3 * SAL_Platform class which defines a token to later be associated with a Jetpack site
4 *
5 * @package automattic/jetpack
6 */
7
8 require_once __DIR__ . '/class.json-api-token.php';
9
10 /**
11 * Base class for SAL_Platform
12 */
13 abstract class SAL_Platform {
14 /**
15 * A token that will represent a SAL_Token instance, default is empty.
16 *
17 * @var SAL_Token
18 */
19 public $token;
20
21 /**
22 * Contructs the SAL_Platform instance
23 *
24 * @param SAL_Token $token The variable which will store the SAL_Token instance.
25 */
26 public function __construct( $token ) {
27 if ( is_array( $token ) ) {
28 $token = SAL_Token::from_rest_token( $token );
29 } else {
30 $token = SAL_Token::for_anonymous_user();
31 }
32
33 $this->token = $token;
34 }
35
36 /**
37 * This is the get_site function declaration, initially not implemented.
38 *
39 * @param int $blog_id The sites Jetpack blog ID.
40 * @see class.json-api-platform-jetpack.php for the implementation of this function.
41 */
42 abstract public function get_site( $blog_id );
43 }
44
45 if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
46 require_once dirname( WP_CONTENT_DIR ) . '/public.api/rest/sal/class.json-api-platform-wpcom.php';
47 } else {
48 require_once __DIR__ . '/class.json-api-platform-jetpack.php';
49 }
50