[wp-trac] [WordPress Trac] #40518: multisite users table should use user's ID to get the avatar
WordPress Trac
noreply at wordpress.org
Fri Apr 21 18:51:09 UTC 2017
#40518: multisite users table should use user's ID to get the avatar
-------------------------+-----------------------------
Reporter: mc256 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.7.4
Severity: normal | Keywords:
Focuses: multisite |
-------------------------+-----------------------------
In class-wp-users-list-tables.php, the get_avatar() uses WP_User 's ID.
{{{#!php
<?php
$avatar = get_avatar( $user_object->ID, 32 );
// Comma-separated list of user roles.
$roles_list = implode( ', ', $user_roles );
$r = "<tr id='user-$user_object->ID'>";
}}}
(around line 438)
However, in class-wp-ms-users-list-table.php, the get_avatar() uses
WP_User 's email address.
{{{#!php
<?php
$super_admins = get_super_admins();
$avatar = get_avatar( $user->user_email, 32 );
$edit_link = esc_url( add_query_arg( 'wp_http_referer',
urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link(
$user->ID ) ) );
echo $avatar;
}}}
(around line 238)
In my opinion, class-wp-ms-users-list-table.php should have the same
behaviour. And we have already known that the user has been registered. So
we should better use the User's ID.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40518>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list