Deprecate wp_convert_bytes_to_hr() in favor of size_format(). props F J Kaiser. fixes #19067.

git-svn-id: https://develop.svn.wordpress.org/trunk@23439 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2013-02-16 03:07:56 +00:00
parent aedda3210c
commit eeda24f865
3 changed files with 16 additions and 17 deletions
-16
View File
@@ -1129,22 +1129,6 @@ function wp_convert_hr_to_bytes( $size ) {
return $bytes;
}
/**
* Converts an integer byte value to a shorthand byte value.
*
* @since 2.3.0
*
* @param int $bytes An integer byte value.
* @return string A shorthand byte value.
*/
function wp_convert_bytes_to_hr( $bytes ) {
$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
$log = log( $bytes, 1024 );
$power = (int) $log;
$size = pow( 1024, $log - $power );
return $size . $units[$power];
}
/**
* Determine the maximum upload size allowed in php.ini.
*