Working code:
// Add custom column with file size info to attachment page
add_filter( \'manage_media_columns\', \'bb2_manage_media_columns\', 10, 2 );
function bb2_manage_media_columns( $columns )
{
$columns[\'filesize\'] = __( \'Storlek\', \'bb2\' );
return $columns;
}
add_action( \'manage_media_custom_column\', \'bb2_manage_media_custom_column\', 10, 2 );
function bb2_manage_media_custom_column( $column_name, $id )
{
switch ( $column_name )
{
case \'filesize\' :
$bytes = filesize(get_attached_file($id));
echo size_format($bytes);
break;
default :
break;
}
}