In get_avatar()
, avoid a second get_avatar_data()
call to get the 2x URL.
props ravinderk. fixes #32572. git-svn-id: https://develop.svn.wordpress.org/trunk@32702 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
63183254c9
commit
9dcaac39e2
@ -2229,20 +2229,20 @@ 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'];
|
||||||
|
|
||||||
if ( ! $url || is_wp_error( $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' );
|
$class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' );
|
||||||
|
|
||||||
if ( ! $args['found_avatar'] || $args['force_default'] ) {
|
if ( ! $args['found_avatar'] || $args['force_default'] ) {
|
||||||
$class[] = 'avatar-default';
|
$class[] = 'avatar-default';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $args['class'] ) {
|
if ( $args['class'] ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user