Force default avatar for HiDPI avatars on Discussion Settings.

props SergeyBiryukov.
fixes #31972.

git-svn-id: https://develop.svn.wordpress.org/trunk@32129 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2015-04-14 18:08:15 +00:00
parent be2e1d9937
commit f00aa86644
1 changed files with 3 additions and 1 deletions

View File

@ -272,7 +272,9 @@ foreach ( $avatar_defaults as $default_key => $default_name ) {
$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> "; $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> ";
$avatar = get_avatar( $user_email, $size, $default_key ); $avatar = get_avatar( $user_email, $size, $default_key );
$avatar_list .= preg_replace("/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar); $avatar = preg_replace( "/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar );
$avatar = preg_replace( "/srcset='(.+?) 2x'/", "srcset='\$1&amp;forcedefault=1 2x'", $avatar );
$avatar_list .= $avatar;
$avatar_list .= ' ' . $default_name . '</label>'; $avatar_list .= ' ' . $default_name . '</label>';
$avatar_list .= '<br />'; $avatar_list .= '<br />';