@@ 276-285 (lines=10) @@ | ||
273 | * @return bool Whether the given user meta key is set. |
|
274 | */ |
|
275 | public function __isset( $key ) { |
|
276 | if ( 'id' == $key ) { |
|
277 | _deprecated_argument( 'WP_User->id', '2.1.0', |
|
278 | sprintf( |
|
279 | /* translators: %s: WP_User->ID */ |
|
280 | __( 'Use %s instead.' ), |
|
281 | '<code>WP_User->ID</code>' |
|
282 | ) |
|
283 | ); |
|
284 | $key = 'ID'; |
|
285 | } |
|
286 | ||
287 | if ( isset( $this->data->$key ) ) |
|
288 | return true; |
|
@@ 306-315 (lines=10) @@ | ||
303 | * @return mixed Value of the given user meta key (if set). If `$key` is 'id', the user ID. |
|
304 | */ |
|
305 | public function __get( $key ) { |
|
306 | if ( 'id' == $key ) { |
|
307 | _deprecated_argument( 'WP_User->id', '2.1.0', |
|
308 | sprintf( |
|
309 | /* translators: %s: WP_User->ID */ |
|
310 | __( 'Use %s instead.' ), |
|
311 | '<code>WP_User->ID</code>' |
|
312 | ) |
|
313 | ); |
|
314 | return $this->ID; |
|
315 | } |
|
316 | ||
317 | if ( isset( $this->data->$key ) ) { |
|
318 | $value = $this->data->$key; |
|
@@ 345-355 (lines=11) @@ | ||
342 | * @param mixed $value User meta value. |
|
343 | */ |
|
344 | public function __set( $key, $value ) { |
|
345 | if ( 'id' == $key ) { |
|
346 | _deprecated_argument( 'WP_User->id', '2.1.0', |
|
347 | sprintf( |
|
348 | /* translators: %s: WP_User->ID */ |
|
349 | __( 'Use %s instead.' ), |
|
350 | '<code>WP_User->ID</code>' |
|
351 | ) |
|
352 | ); |
|
353 | $this->ID = $value; |
|
354 | return; |
|
355 | } |
|
356 | ||
357 | $this->data->$key = $value; |
|
358 | } |