mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user