Show User Profile Picture in Admin

Display user profile picture in the admin user list.

<?php
function add_profile_picture_column($columns) {
    $columns['profile_picture'] = 'Profile Picture';
    return $columns;
}
add_filter('manage_users_columns', 'add_profile_picture_column');

function show_profile_picture_column($value, $column_name, $user_id) {
    if ($column_name == 'profile_picture') {
        $user_info = get_userdata($user_id);
        $avatar = get_avatar($user_id, 32);
        return $avatar;
    }
    return $value;
}
add_action('manage_users_custom_column', 'show_profile_picture_column', 10, 3);

Post Comment