Ticket #38630: 38630.diff
File 38630.diff, 2.6 KB (added by , 9 years ago) |
---|
-
src/wp-includes/class-wp-site.php
15 15 * 16 16 * @since 4.5.0 17 17 * 18 * @property int $id19 * @property int $network_id20 18 * @property string $blogname 21 19 * @property string $siteurl 22 20 * @property int $post_count … … 27 25 /** 28 26 * Site ID. 29 27 * 30 * A numeric string, for compatibility reasons. 31 * 32 * @since 4.5.0 28 * @since 4.8.0 33 29 * @access public 34 * @var string30 * @var int 35 31 */ 36 public $ blog_id;32 public $id; 37 33 38 34 /** 39 35 * Domain of the site. … … 56 52 /** 57 53 * The ID of the site's parent network. 58 54 * 59 * Named "site" vs. "network" for legacy reasons. An individual site's "site" is 60 * its network. 61 * 62 * A numeric string, for compatibility reasons. 63 * 64 * @since 4.5.0 55 * @since 4.8.0 65 56 * @access public 66 * @var string57 * @var int 67 58 */ 68 public $ site_id = '0';59 public $network_id = 0; 69 60 70 61 /** 71 62 * The date on which the site was created or registered. … … 202 193 */ 203 194 public function __construct( $site ) { 204 195 foreach( get_object_vars( $site ) as $key => $value ) { 205 $this-> $key = $value;196 $this->__set( $key, $value ); 206 197 } 207 198 } 208 199 … … 233 224 public function __get( $key ) { 234 225 switch ( $key ) { 235 226 case 'id': 236 return (int) $this-> blog_id;227 return (int) $this->id; 237 228 case 'network_id': 238 return (int) $this-> site_id;229 return (int) $this->network_id; 239 230 case 'blogname': 240 231 case 'siteurl': 241 232 case 'post_count': … … 245 236 } 246 237 $details = $this->get_details(); 247 238 return $details->$key; 239 240 // Support blog_id for legacy reasons. 241 case 'blog_id': 242 return (string) $this->id; 243 244 // Support site_id for legacy reasons. 245 case 'site_id': 246 return (string) $this->network_id; 248 247 } 249 248 250 249 return null; … … 275 274 return false; 276 275 } 277 276 return true; 277 278 // Support blog_id and site_id for legacy reasons. 279 case 'blog_id': 280 case 'site_id': 281 return true; 278 282 } 279 283 280 284 return false; … … 293 297 */ 294 298 public function __set( $key, $value ) { 295 299 switch ( $key ) { 300 // Support blog_id for legacy reasons. 301 case 'blog_id': 296 302 case 'id': 297 $this-> blog_id = (string) $value;303 $this->id = (int) $value; 298 304 break; 305 306 // Support site_id for legacy reasons. 307 case 'site_id': 299 308 case 'network_id': 300 $this-> site_id = (string) $value;309 $this->network_id = (int) $value; 301 310 break; 302 311 default: 303 312 $this->$key = $value;