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,20 +2229,20 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
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 );
$url = $args['url'];
if ( ! $url || is_wp_error( $url ) ) {
return false;
return false;
}
$url2x = add_query_arg( array( 's' => $args['size'] * 2 ), $args['url'] );
$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
if ( ! $args['found_avatar'] || $args['force_default'] ) {
$class[] = 'avatar-default';
$class[] = 'avatar-default';
}
if ( $args['class'] ) {

View File

@ -4,7 +4,7 @@
*
* @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.