wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema
wp_convert_bytes_to_hr is deprecated since version 3.6.0!
Alternative: Ver página de detalhe para size_format »" href="https://pt.wpseek.com/function/size_format/">size_format()
Alternative: Ver página de detalhe para size_format »" href="https://pt.wpseek.com/function/size_format/">size_format()
wp_convert_bytes_to_hr › WordPress Function
Desde2.3.0
Obsoleto3.6.0
› wp_convert_bytes_to_hr ( $bytes )
Parâmetros: |
|
Ver: | |
Retorna: |
|
Definido em: |
|
Codex: |
Converts an integer byte value to a shorthand byte value.
Funções relacionadas: wp_convert_hr_to_bytes, convert_to_screen, wp_count_terms, wp_count_sites, wp_insert_term
Fonte
function wp_convert_bytes_to_hr( $bytes ) { _deprecated_function( __FUNCTION__, '3.6.0', 'size_format()' ); $units = array( 0 => 'B', 1 => 'KB', 2 => 'MB', 3 => 'GB', 4 => 'TB' ); $log = log( $bytes, KB_IN_BYTES ); $power = (int) $log; $size = KB_IN_BYTES ** ( $log - $power ); if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) { $unit = $units[ $power ]; } else { $size = $bytes; $unit = $units[0]; } return $size . $unit; }