diff --git wp-includes/pluggable.php wp-includes/pluggable.php
index ac308a9..11d769f 100644
|
|
if ( !function_exists('get_user_by') ) : |
133 | 133 | * @return bool|object False on failure, WP_User object on success |
134 | 134 | */ |
135 | 135 | function get_user_by( $field, $value ) { |
| 136 | static $cache = array(); |
136 | 137 | $userdata = WP_User::get_data_by( $field, $value ); |
137 | 138 | |
138 | 139 | if ( !$userdata ) |
139 | 140 | return false; |
140 | 141 | |
| 142 | $key = $field . '|' . $value; |
| 143 | if ( isset( $cache[$key] ) ) |
| 144 | return $cache[$key]; |
| 145 | |
141 | 146 | $user = new WP_User; |
142 | 147 | $user->init( $userdata ); |
143 | 148 | |
144 | | return $user; |
| 149 | $cache[$key] = $user; |
| 150 | return $cache[$key]; |
145 | 151 | } |
146 | 152 | endif; |
147 | 153 | |