Make WordPress Core


Ignore:
Timestamp:
08/20/2012 09:58:34 PM (12 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r21413 r21563  
    134134 */
    135135function get_user_by( $field, $value ) {
    136     if ( 'id' === $field && (int) $value && get_current_user_id() === (int) $value )
    137         return wp_get_current_user();
    138 
    139136    $userdata = WP_User::get_data_by( $field, $value );
    140137
Note: See TracChangeset for help on using the changeset viewer.