Multisite: Revert property type changes in `WP_Site`.

Partial revert of [37657]. Moving existing properties in `WP_Site` from public to private broke backwards compatibility in a pretty severe way. We made an initial attempt to work around this, but due to the variety of possible issues, moving forward does not seem wise.

Fixes #36717.


git-svn-id: https://develop.svn.wordpress.org/trunk@37923 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2016-06-29 22:07:17 +00:00
parent f30e343b12
commit 04fecbc5aa
1 changed files with 4 additions and 16 deletions

View File

@ -26,12 +26,10 @@ final class WP_Site {
* A numeric string, for compatibility reasons. * A numeric string, for compatibility reasons.
* *
* @since 4.5.0 * @since 4.5.0
* @since 4.6.0 Converted from public to private to explicitly enable more intuitive * @access public
* access via magic methods.
* @access private
* @var string * @var string
*/ */
private $blog_id; public $blog_id;
/** /**
* Domain of the site. * Domain of the site.
@ -60,12 +58,10 @@ final class WP_Site {
* A numeric string, for compatibility reasons. * A numeric string, for compatibility reasons.
* *
* @since 4.5.0 * @since 4.5.0
* @since 4.6.0 Converted from public to private to explicitly enable more intuitive * @access public
* access via magic methods.
* @access private
* @var string * @var string
*/ */
private $site_id = '0'; public $site_id = '0';
/** /**
* The date on which the site was created or registered. * The date on which the site was created or registered.
@ -234,10 +230,6 @@ final class WP_Site {
switch ( $key ) { switch ( $key ) {
case 'id': case 'id':
return (int) $this->blog_id; return (int) $this->blog_id;
case 'blog_id':
return $this->blog_id;
case 'site_id':
return $this->site_id;
case 'network_id': case 'network_id':
return (int) $this->site_id; return (int) $this->site_id;
case 'blogname': case 'blogname':
@ -269,8 +261,6 @@ final class WP_Site {
public function __isset( $key ) { public function __isset( $key ) {
switch ( $key ) { switch ( $key ) {
case 'id': case 'id':
case 'blog_id':
case 'site_id':
case 'network_id': case 'network_id':
return true; return true;
case 'blogname': case 'blogname':
@ -300,10 +290,8 @@ final class WP_Site {
public function __set( $key, $value ) { public function __set( $key, $value ) {
switch ( $key ) { switch ( $key ) {
case 'id': case 'id':
case 'blog_id':
$this->blog_id = (string) $value; $this->blog_id = (string) $value;
break; break;
case 'site_id':
case 'network_id': case 'network_id':
$this->site_id = (string) $value; $this->site_id = (string) $value;
break; break;