Skip to content

Commit daecbc9

Browse files
committed
Classes that have __set() also need __isset() and __unset().
See #27881, #22234. git-svn-id: https://develop.svn.wordpress.org/trunk@28524 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bf54ad6 commit daecbc9

9 files changed

Lines changed: 197 additions & 0 deletions

src/wp-admin/custom-background.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ public function __set( $name, $value ) {
8181
return $this->$name = $value;
8282
}
8383

84+
/**
85+
* Make private properties checkable for backwards compatibility
86+
*
87+
* @since 4.0.0
88+
* @param string $name
89+
* @return mixed
90+
*/
91+
public function __isset( $name ) {
92+
return isset( $this->$name );
93+
}
94+
95+
/**
96+
* Make private properties unsetable for backwards compatibility
97+
*
98+
* @since 4.0.0
99+
* @param string $name
100+
* @return mixed
101+
*/
102+
public function __unset( $name ) {
103+
unset( $this->$name );
104+
}
84105

85106
/**
86107
* Set up the hooks for the Custom Background admin page.

src/wp-admin/custom-header.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,28 @@ public function __set( $name, $value ) {
103103
return $this->$name = $value;
104104
}
105105

106+
/**
107+
* Make private properties checkable for backwards compatibility
108+
*
109+
* @since 4.0.0
110+
* @param string $name
111+
* @return mixed
112+
*/
113+
public function __isset( $name ) {
114+
return isset( $this->$name );
115+
}
116+
117+
/**
118+
* Make private properties unsetable for backwards compatibility
119+
*
120+
* @since 4.0.0
121+
* @param string $name
122+
* @return mixed
123+
*/
124+
public function __unset( $name ) {
125+
unset( $this->$name );
126+
}
127+
106128
/**
107129
* Set up the hooks for the Custom Header admin page.
108130
*

src/wp-admin/includes/class-wp-filesystem-base.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@ public function __set( $name, $value ) {
6767
return $this->$name = $value;
6868
}
6969

70+
/**
71+
* Make private properties checkable for backwards compatibility
72+
*
73+
* @since 4.0.0
74+
* @param string $name
75+
* @return mixed
76+
*/
77+
public function __isset( $name ) {
78+
return isset( $this->$name );
79+
}
80+
81+
/**
82+
* Make private properties unsetable for backwards compatibility
83+
*
84+
* @since 4.0.0
85+
* @param string $name
86+
* @return mixed
87+
*/
88+
public function __unset( $name ) {
89+
unset( $this->$name );
90+
}
91+
7092
/**
7193
* Return the path on the remote filesystem of ABSPATH.
7294
*

src/wp-admin/includes/class-wp-list-table.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,28 @@ public function __set( $name, $value ) {
118118
return $this->$name = $value;
119119
}
120120

121+
/**
122+
* Make private properties checkable for backwards compatibility
123+
*
124+
* @since 4.0.0
125+
* @param string $name
126+
* @return mixed
127+
*/
128+
public function __isset( $name ) {
129+
return isset( $this->$name );
130+
}
131+
132+
/**
133+
* Make private properties unsetable for backwards compatibility
134+
*
135+
* @since 4.0.0
136+
* @param string $name
137+
* @return mixed
138+
*/
139+
public function __unset( $name ) {
140+
unset( $this->$name );
141+
}
142+
121143
/**
122144
* Make private/protected methods readable for backwards compatibility
123145
*

src/wp-includes/cache.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,28 @@ public function __set( $name, $value ) {
329329
return $this->$name = $value;
330330
}
331331

332+
/**
333+
* Make private properties checkable for backwards compatibility
334+
*
335+
* @since 4.0.0
336+
* @param string $name
337+
* @return mixed
338+
*/
339+
public function __isset( $name ) {
340+
return isset( $this->$name );
341+
}
342+
343+
/**
344+
* Make private properties unsetable for backwards compatibility
345+
*
346+
* @since 4.0.0
347+
* @param string $name
348+
* @return mixed
349+
*/
350+
public function __unset( $name ) {
351+
unset( $this->$name );
352+
}
353+
332354
/**
333355
* Adds data to the cache if it doesn't already exist.
334356
*

src/wp-includes/class-wp-ajax-response.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ public function __set( $name, $value ) {
5252
return $this->$name = $value;
5353
}
5454

55+
/**
56+
* Make private properties checkable for backwards compatibility
57+
*
58+
* @since 4.0.0
59+
* @param string $name
60+
* @return mixed
61+
*/
62+
public function __isset( $name ) {
63+
return isset( $this->$name );
64+
}
65+
66+
/**
67+
* Make private properties unsetable for backwards compatibility
68+
*
69+
* @since 4.0.0
70+
* @param string $name
71+
* @return mixed
72+
*/
73+
public function __unset( $name ) {
74+
unset( $this->$name );
75+
}
76+
5577
/**
5678
* Append to XML response based on given arguments.
5779
*

src/wp-includes/class-wp-error.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,28 @@ public function __set( $name, $value ) {
8787
return $this->$name = $value;
8888
}
8989

90+
/**
91+
* Make private properties checkable for backwards compatibility
92+
*
93+
* @since 4.0.0
94+
* @param string $name
95+
* @return mixed
96+
*/
97+
public function __isset( $name ) {
98+
return isset( $this->$name );
99+
}
100+
101+
/**
102+
* Make private properties unsetable for backwards compatibility
103+
*
104+
* @since 4.0.0
105+
* @param string $name
106+
* @return mixed
107+
*/
108+
public function __unset( $name ) {
109+
unset( $this->$name );
110+
}
111+
90112
/**
91113
* Retrieve all error codes.
92114
*

src/wp-includes/class-wp-walker.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,28 @@ public function __set( $name, $value ) {
6262
return $this->$name = $value;
6363
}
6464

65+
/**
66+
* Make private properties checkable for backwards compatibility
67+
*
68+
* @since 4.0.0
69+
* @param string $name
70+
* @return mixed
71+
*/
72+
public function __isset( $name ) {
73+
return isset( $this->$name );
74+
}
75+
76+
/**
77+
* Make private properties unsetable for backwards compatibility
78+
*
79+
* @since 4.0.0
80+
* @param string $name
81+
* @return mixed
82+
*/
83+
public function __unset( $name ) {
84+
unset( $this->$name );
85+
}
86+
6587
/**
6688
* Starts the list before the elements are added.
6789
*

src/wp-includes/class-wp.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,28 @@ public function __set( $name, $value ) {
685685
return $this->$name = $value;
686686
}
687687

688+
/**
689+
* Make private properties checkable for backwards compatibility
690+
*
691+
* @since 4.0.0
692+
* @param string $name
693+
* @return mixed
694+
*/
695+
public function __isset( $name ) {
696+
return isset( $this->$name );
697+
}
698+
699+
/**
700+
* Make private properties unsetable for backwards compatibility
701+
*
702+
* @since 4.0.0
703+
* @param string $name
704+
* @return mixed
705+
*/
706+
public function __unset( $name ) {
707+
unset( $this->$name );
708+
}
709+
688710
/**
689711
* Make private/protected methods readable for backwards compatibility
690712
*

0 commit comments

Comments
 (0)