1 | <?php |
||
11 | class Jetpack_Mapbox_Helper { |
||
12 | /** |
||
13 | * Site option key for the Mapbox service. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | private static $site_option_key = 'mapbox_api_key'; |
||
18 | |||
19 | /** |
||
20 | * Transient key for the WordPress.com Mapbox access token. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private static $transient_key = 'wpcom_mapbox_access_token'; |
||
25 | |||
26 | /** |
||
27 | * Get the site's own Mapbox access token if set, or the WordPress.com's one otherwise. |
||
28 | * |
||
29 | * @return array An array containing the key (if any) and its source ("site" or "wpcom"). |
||
30 | */ |
||
31 | public static function get_access_token() { |
||
72 | |||
73 | /** |
||
74 | * Check if we're in WordPress.com. |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | private static function is_wpcom() { |
||
81 | |||
82 | /** |
||
83 | * Get the current site's WordPress.com ID. |
||
84 | * |
||
85 | * @return mixed The site's WordPress.com ID. |
||
86 | */ |
||
87 | private static function get_wpcom_site_id() { |
||
95 | |||
96 | /** |
||
97 | * Format an access token and its source into an array. |
||
98 | * |
||
99 | * @param string $key The API key. |
||
100 | * @param string $source The key's source ("site" or "wpcom"). |
||
101 | * @return array |
||
102 | */ |
||
103 | private static function format_access_token( $key = '', $source = 'site' ) { |
||
109 | } |
||
110 |