Make WordPress Core

Changeset 23439


Ignore:
Timestamp:
02/16/2013 03:07:56 AM (12 years ago)
Author:
SergeyBiryukov
Message:

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

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r23416 r23439  
    777777function wp_import_upload_form( $action ) {
    778778    $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
    779     $size = wp_convert_bytes_to_hr( $bytes );
     779    $size = size_format( $bytes );
    780780    $upload_dir = wp_upload_dir();
    781781    if ( ! empty( $upload_dir['error'] ) ) :
  • trunk/wp-includes/deprecated.php

    r23416 r23439  
    33653365    return false;
    33663366}
     3367
     3368/**
     3369 * Converts an integer byte value to a shorthand byte value.
     3370 *
     3371 * @since 2.3.0
     3372 * @deprecated 3.6.0
     3373 * @deprecated Use size_format()
     3374 *
     3375 * @param int $bytes An integer byte value.
     3376 * @return string A shorthand byte value.
     3377 */
     3378function wp_convert_bytes_to_hr( $bytes ) {
     3379    _deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
     3380    return size_format( $bytes );
     3381}
  • trunk/wp-includes/media.php

    r23437 r23439  
    11311131
    11321132/**
    1133  * Converts an integer byte value to a shorthand byte value.
    1134  *
    1135  * @since 2.3.0
    1136  *
    1137  * @param int $bytes An integer byte value.
    1138  * @return string A shorthand byte value.
    1139  */
    1140 function wp_convert_bytes_to_hr( $bytes ) {
    1141     $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
    1142     $log   = log( $bytes, 1024 );
    1143     $power = (int) $log;
    1144     $size  = pow( 1024, $log - $power );
    1145     return $size . $units[$power];
    1146 }
    1147 
    1148 /**
    11491133 * Determine the maximum upload size allowed in php.ini.
    11501134 *
Note: See TracChangeset for help on using the changeset viewer.