Total Complexity | 3 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php # -*- coding: utf-8 -*- |
||
9 | class Site |
||
10 | { |
||
11 | const SITE_ID = 'global_media.site_id'; |
||
12 | const META_KEY_SITE_ID = 'global_media_site_id'; |
||
13 | |||
14 | const SITE_ID_PREFIX_RIGHT_PAD = '00000'; |
||
15 | |||
16 | /** |
||
17 | * Return the ID of site that store the media files. |
||
18 | * |
||
19 | * @since 2017-12-01 |
||
20 | * @return integer The site ID. |
||
21 | */ |
||
22 | public function id(): int |
||
23 | { |
||
24 | return (int)apply_filters(self::SITE_ID, 1); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Return the site id prefix for attachments |
||
29 | * |
||
30 | * @return string |
||
31 | */ |
||
32 | public function idSitePrefix(): string |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Returns whether or not we're currently on the network media library site, |
||
39 | * regardless of any switching that's occurred. |
||
40 | * |
||
41 | * `$current_blog` can be used to determine the "actual" site as it doesn't |
||
42 | * change when switching sites. |
||
43 | * |
||
44 | * @return bool Whether we're on the network media library site. |
||
45 | */ |
||
46 | public function isMediaSite(): bool |
||
51 |