diff --git src/wp-includes/class-wp-network.php src/wp-includes/class-wp-network.php
old mode 100644
new mode 100755
index 5ab29c2..a776ed4
|
|
|
|
| 17 | 17 | * ability to interact with any network of sites is required. |
| 18 | 18 | * |
| 19 | 19 | * @since 4.4.0 |
| 20 | | * |
| 21 | | * @property int $id |
| 22 | | * @property int $site_id |
| 23 | 20 | */ |
| 24 | 21 | class WP_Network { |
| 25 | 22 | |
| … |
… |
|
| 30 | 27 | * @since 4.6.0 Converted from public to private to explicitly enable more intuitive |
| 31 | 28 | * access via magic methods. As part of the access change, the type was |
| 32 | 29 | * also changed from `string` to `int`. |
| 33 | | * @access private |
| | 30 | * @since 4.7.0 Converted back to public |
| | 31 | * @access public |
| 34 | 32 | * @var int |
| 35 | 33 | */ |
| 36 | | private $id; |
| | 34 | public $id; |
| 37 | 35 | |
| 38 | 36 | /** |
| 39 | 37 | * Domain of the network. |
| … |
… |
|
| 56 | 54 | /** |
| 57 | 55 | * The ID of the network's main site. |
| 58 | 56 | * |
| 59 | | * Named "blog" vs. "site" for legacy reasons. A main site is mapped to |
| 60 | | * the network when the network is created. |
| | 57 | * Every network has a "main site" mapped to it when it is created. |
| 61 | 58 | * |
| 62 | | * A numeric string, for compatibility reasons. |
| 63 | | * |
| 64 | | * @since 4.4.0 |
| 65 | | * @access private |
| 66 | | * @var string |
| | 59 | * @since 4.7.0 |
| | 60 | * @access public |
| | 61 | * @var int |
| 67 | 62 | */ |
| 68 | | private $blog_id = '0'; |
| | 63 | public $site_id = 0; |
| 69 | 64 | |
| 70 | 65 | /** |
| 71 | 66 | * Domain used to set cookies for this network. |
| … |
… |
|
| 98 | 93 | * @param int $network_id The ID of the network to retrieve. |
| 99 | 94 | * @return WP_Network|bool The network's object if found. False if not. |
| 100 | 95 | */ |
| 101 | | public static function get_instance( $network_id ) { |
| | 96 | public static function get_instance( $network_id = 0 ) { |
| 102 | 97 | global $wpdb; |
| 103 | 98 | |
| 104 | 99 | $network_id = (int) $network_id; |
| … |
… |
|
| 134 | 129 | */ |
| 135 | 130 | public function __construct( $network ) { |
| 136 | 131 | foreach( get_object_vars( $network ) as $key => $value ) { |
| 137 | | $this->$key = $value; |
| | 132 | $this->__set( $key, $value ); |
| 138 | 133 | } |
| 139 | 134 | |
| 140 | 135 | $this->_set_site_name(); |
| … |
… |
|
| 156 | 151 | switch ( $key ) { |
| 157 | 152 | case 'id'; |
| 158 | 153 | return (int) $this->id; |
| 159 | | case 'blog_id': |
| 160 | | return $this->blog_id; |
| 161 | 154 | case 'site_id': |
| 162 | | return (int) $this->blog_id; |
| | 155 | return (int) $this->site_id; |
| | 156 | |
| | 157 | // Support blog_id for legacy reasons |
| | 158 | case 'blog_id': |
| | 159 | return (string) $this->site_id; |
| 163 | 160 | } |
| 164 | 161 | |
| 165 | 162 | return null; |
| … |
… |
|
| 179 | 176 | public function __isset( $key ) { |
| 180 | 177 | switch ( $key ) { |
| 181 | 178 | case 'id': |
| 182 | | case 'blog_id': |
| 183 | 179 | case 'site_id': |
| | 180 | |
| | 181 | // Support blog_id for legacy reasons |
| | 182 | case 'blog_id': |
| 184 | 183 | return true; |
| 185 | 184 | } |
| 186 | 185 | |
| … |
… |
|
| 203 | 202 | case 'id': |
| 204 | 203 | $this->id = (int) $value; |
| 205 | 204 | break; |
| | 205 | |
| | 206 | // Support blog_id for legacy reasons |
| 206 | 207 | case 'blog_id': |
| 207 | 208 | case 'site_id': |
| 208 | | $this->blog_id = (string) $value; |
| | 209 | $this->site_id = (int) $value; |
| 209 | 210 | break; |
| 210 | 211 | default: |
| 211 | 212 | $this->$key = $value; |