mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
Gravatars: Enable HiDPI versions for browsers that support srcset.
props iseulde. see #22329. Built from https://develop.svn.wordpress.org/trunk@31721 git-svn-id: http://core.svn.wordpress.org/trunk@31702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4eba346517
commit
0bf35836c3
@ -2174,7 +2174,7 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
|
||||
$args = array();
|
||||
}
|
||||
|
||||
$args['size'] = $size;
|
||||
$args['size'] = (int) $size;
|
||||
$args['default'] = $default;
|
||||
$args['alt'] = $alt;
|
||||
|
||||
@ -2209,6 +2209,8 @@ 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'];
|
||||
@ -2232,9 +2234,10 @@ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args =
|
||||
}
|
||||
|
||||
$avatar = sprintf(
|
||||
"<img alt='%s' src='%s' class='%s' height='%d' width='%d' %s/>",
|
||||
"<img alt='%s' src='%s' srcset='%s' class='%s' height='%d' width='%d' %s/>",
|
||||
esc_attr( $args['alt'] ),
|
||||
esc_url( $url ),
|
||||
esc_attr( "$url 1x, $url2x 2x" ),
|
||||
esc_attr( join( ' ', $class ) ),
|
||||
(int) $args['height'],
|
||||
(int) $args['width'],
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31720';
|
||||
$wp_version = '4.2-alpha-31721';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user