summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2013-02-16 03:07:56 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2013-02-16 03:07:56 +0000
commiteeda24f8653a262f3e26cab5529ded623e80c23d (patch)
tree996d654f45cdde4649b899fa5f21cc612fcdc18c
parentaedda3210ce59872a68f64b72c6a5ab43f9c9c63 (diff)
downloadwordpress-eeda24f8653a262f3e26cab5529ded623e80c23d.tar.gz
wordpress-eeda24f8653a262f3e26cab5529ded623e80c23d.zip
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
-rw-r--r--wp-admin/includes/template.php2
-rw-r--r--wp-includes/deprecated.php15
-rw-r--r--wp-includes/media.php16
3 files changed, 16 insertions, 17 deletions
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index bee7befa48..f97798c61b 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -776,7 +776,7 @@ function wp_dropdown_roles( $selected = false ) {
*/
function wp_import_upload_form( $action ) {
$bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
- $size = wp_convert_bytes_to_hr( $bytes );
+ $size = size_format( $bytes );
$upload_dir = wp_upload_dir();
if ( ! empty( $upload_dir['error'] ) ) :
?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php
index 32acbf88fb..e89332f53a 100644
--- a/wp-includes/deprecated.php
+++ b/wp-includes/deprecated.php
@@ -3364,3 +3364,18 @@ function gd_edit_image_support($mime_type) {
}
return false;
}
+
+/**
+ * Converts an integer byte value to a shorthand byte value.
+ *
+ * @since 2.3.0
+ * @deprecated 3.6.0
+ * @deprecated Use size_format()
+ *
+ * @param int $bytes An integer byte value.
+ * @return string A shorthand byte value.
+ */
+function wp_convert_bytes_to_hr( $bytes ) {
+ _deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
+ return size_format( $bytes );
+}
diff --git a/wp-includes/media.php b/wp-includes/media.php
index f4e13a4a9b..f1f373735e 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -1130,22 +1130,6 @@ function wp_convert_hr_to_bytes( $size ) {
}
/**
- * 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.
*
* @since 2.5.0