Deprecate User#__get(). It causes too many cache-related headaches
Showing
1 changed file
with
8 additions
and
0 deletions
| ... | @@ -14,6 +14,14 @@ class User { | ... | @@ -14,6 +14,14 @@ class User { |
| 14 | $this->id = $this->ID = $this->_wpuser->id; | 14 | $this->id = $this->ID = $this->_wpuser->id; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | /** | ||
| 18 | * @deprecated This method has caused MANY headaches with it's caching implementation. | ||
| 19 | * It bypasses the metacache (which gets updated when any meta field is set | ||
| 20 | * or retrieved), so causes the data used elsewhwere to be stale. BAD STUFF. | ||
| 21 | * @param $key | ||
| 22 | * | ||
| 23 | * @return mixed | ||
| 24 | */ | ||
| 17 | public function __get($key) { | 25 | public function __get($key) { |
| 18 | if (isset($this->_wpuser->{$key})) { | 26 | if (isset($this->_wpuser->{$key})) { |
| 19 | return $this->_wpuser->{$key}; | 27 | return $this->_wpuser->{$key}; | ... | ... |
-
Please register or sign in to post a comment