Make WordPress Core


Ignore:
Timestamp:
06/07/2015 02:57:11 PM (10 years ago)
Author:
SergeyBiryukov
Message:

In get_avatar(), avoid a second get_avatar_data() call to get the 2x URL.

props ravinderk.
fixes #32572.

File:
1 edited

Legend:

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

    r32692 r32702  
    22302230    }
    22312231
    2232     $url2x = get_avatar_url( $id_or_email, array_merge( $args, array( 'size' => $args['size'] * 2 ) ) );
    2233 
    22342232    $args = get_avatar_data( $id_or_email, $args );
    22352233
     
    22372235
    22382236    if ( ! $url || is_wp_error( $url ) ) {
    2239         return false;
    2240     }
     2237        return false;
     2238    }
     2239
     2240    $url2x = add_query_arg( array( 's' => $args['size'] * 2 ), $args['url'] );
    22412241
    22422242    $class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
    22432243
    22442244    if ( ! $args['found_avatar'] || $args['force_default'] ) {
    2245         $class[] = 'avatar-default';
     2245        $class[] = 'avatar-default';
    22462246    }
    22472247
Note: See TracChangeset for help on using the changeset viewer.