WordPress.org

Make WordPress Core

Changeset 23440


Ignore:
Timestamp:
02/16/2013 03:59:37 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Restore the original wp_convert_bytes_to_hr() code. fixes #19067.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/deprecated.php

    r23439 r23440  
    33783378function wp_convert_bytes_to_hr( $bytes ) {
    33793379    _deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
    3380     return size_format( $bytes );
    3381 }
     3380    $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
     3381    $log   = log( $bytes, 1024 );
     3382    $power = (int) $log;
     3383    $size  = pow( 1024, $log - $power );
     3384    return $size . $units[$power];
     3385}
Note: See TracChangeset for help on using the changeset viewer.