Make WordPress Core


Ignore:
Timestamp:
07/05/2020 12:58:20 PM (6 years ago)
Author:
ocean90
Message:

Posts: Provide a HiDPI version for the avatar used in post locked dialogs.

Props wpdesk, audrasjb, ocean90.
Fixes #39633.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/misc.php

    r48277 r48318  
    10541054                    );
    10551055
    1056                     $avatar = get_avatar( $user->ID, 18 );
    1057                     if ( $avatar && preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
    1058                         $send['avatar_src'] = $matches[1];
     1056                    if ( get_option( 'show_avatars' ) ) {
     1057                        $send['avatar_src']    = get_avatar_url( $user->ID, array( 'size' => 18 ) );
     1058                        $send['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 36 ) );
    10591059                    }
    10601060
     
    11041104            );
    11051105
    1106             $avatar = get_avatar( $user->ID, 64 );
    1107             if ( $avatar ) {
    1108                 if ( preg_match( "|src='([^']+)'|", $avatar, $matches ) ) {
    1109                     $error['avatar_src'] = $matches[1];
    1110                 }
     1106            if ( get_option( 'show_avatars' ) ) {
     1107                $error['avatar_src']    = get_avatar_url( $user->ID, array( 'size' => 64 ) );
     1108                $error['avatar_src_2x'] = get_avatar_url( $user->ID, array( 'size' => 128 ) );
    11111109            }
    11121110
Note: See TracChangeset for help on using the changeset viewer.