Display User ID in WordPress

add_filter( 'manage_users_columns', 'show_user_id' );
add_filter( 'manage_users_custom_column', 'display_id', 11, 4 );
function show_user_id( $columns ) 
{
    $columns['user_id'] = 'ID';
    return $columns;
}

function display_id( $empty, $column, $user_id ) 
{
    if ( 'user_id' != $column)
        return $empty;

    return "<strong>$user_id</strong>";
}

Leave a Reply