mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Move the optimization done to get_user_by() in [21376] higher up the stack, into map_meta_cap() and is_super_admin().
This provides nearly the same benefits without possibly receiving a stale object from get_userdata(), which could affect authentication, and introduce side effects for plugins. see #21120. git-svn-id: https://develop.svn.wordpress.org/trunk@21563 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -133,9 +133,6 @@ if ( !function_exists('get_user_by') ) :
|
||||
* @return bool|object False on failure, WP_User object on success
|
||||
*/
|
||||
function get_user_by( $field, $value ) {
|
||||
if ( 'id' === $field && (int) $value && get_current_user_id() === (int) $value )
|
||||
return wp_get_current_user();
|
||||
|
||||
$userdata = WP_User::get_data_by( $field, $value );
|
||||
|
||||
if ( !$userdata )
|
||||
|
||||
Reference in New Issue
Block a user