Make WordPress Core

Ticket #19067: 19067_4.patch

File 19067_4.patch, 1.8 KB (added by F J Kaiser, 13 years ago)

moved to wp-includes/deprecated.php & added size_format() as 3rd arg. for _deprecated_function() call - else same as previous patches

  • wp-admin/includes/template.php

     
    775775/**
    776776 * {@internal Missing Short Description}}
    777777 *
    778  * @since 2.3.0
    779  *
    780  * @param unknown_type $bytes
    781  * @return unknown
    782  */
    783 function 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];
    789 }
    790 
    791 /**
    792  * {@internal Missing Short Description}}
    793  *
    794778 * @since 2.5.0
    795779 *
    796780 * @return unknown
     
    811795 */
    812796function wp_import_upload_form( $action ) {
    813797        $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    814         $size = wp_convert_bytes_to_hr( $bytes );
     798        $size = size_format( $bytes );
    815799        $upload_dir = wp_upload_dir();
    816800        if ( ! empty( $upload_dir['error'] ) ) :
    817801                ?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
  • wp-includes/deprecated.php

     
    28872887
    28882888        return is_user_member_of_blog( get_current_user_id(), $blog_id );
    28892889}
     2890
     2891/**
     2892 * @see size_format()
     2893 *
     2894 * @since 2.3.0
     2895 * @deprecated in favor of size_format()
     2896 *
     2897 * @param int|string $bytes Number of bytes. Note max integer size for integers.
     2898 * @return bool|string False on failure. Number string on success.
     2899 */
     2900function wp_convert_bytes_to_hr( $bytes ) {
     2901        _deprecated_function( __FUNCTION__, '3.3', 'size_format()' );
     2902
     2903        return size_format( $bytes );
     2904}