WordPress.org

Make WordPress Core

Ticket #19067: 19067_2.patch

File 19067_2.patch, 1.1 KB (added by F J Kaiser, 7 years ago)

Made wp_convert_bytes_to_hr() deprecated (added phpDocBlock @deprecated and call to _deprecated_function for @version 3.3) and replaced wp_convert_bytes_to_hr() with size_format()

  • wp-admin/includes/template.php

     
    776776 * {@internal Missing Short Description}}
    777777 *
    778778 * @since 2.3.0
     779 * @deprecated 3.3
    779780 *
    780781 * @param unknown_type $bytes
    781782 * @return unknown
    782783 */
    783784function wp_convert_bytes_to_hr( $bytes ) {
    784         $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
    785         $log = log( $bytes, 1024 );
    786         $power = (int) $log;
    787         $size = pow(1024, $log - $power);
    788         return $size . $units[$power];
     785        _deprecated_function(__FUNCTION__, '3.3' );
     786        return size_format( $bytes );
    789787}
    790788
    791789/**
     
    811809 */
    812810function wp_import_upload_form( $action ) {
    813811        $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    814         $size = wp_convert_bytes_to_hr( $bytes );
     812        $size = size_format( $bytes );
    815813        $upload_dir = wp_upload_dir();
    816814        if ( ! empty( $upload_dir['error'] ) ) :
    817815                ?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>