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

props ravinderk.
fixes #32572.
Built from https://develop.svn.wordpress.org/trunk@32702


git-svn-id: http://core.svn.wordpress.org/trunk@32672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-06-07 14:58:26 +00:00
parent cf31f32475
commit c9dd28908a
2 changed files with 5 additions and 5 deletions

View File

@ -2229,8 +2229,6 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
return false; return false;
} }
$url2x = get_avatar_url( $id_or_email, array_merge( $args, array( 'size' => $args['size'] * 2 ) ) );
$args = get_avatar_data( $id_or_email, $args ); $args = get_avatar_data( $id_or_email, $args );
$url = $args['url']; $url = $args['url'];
@ -2239,6 +2237,8 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
return false; return false;
} }
$url2x = add_query_arg( array( 's' => $args['size'] * 2 ), $args['url'] );
$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' ); $class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
if ( ! $args['found_avatar'] || $args['force_default'] ) { if ( ! $args['found_avatar'] || $args['force_default'] ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-alpha-32701'; $wp_version = '4.3-alpha-32702';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.