Changeset 38012
- Timestamp:
- 07/08/2016 11:26:58 AM (8 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r37985 r38012 975 975 return false; 976 976 } 977 978 /** 979 * Converts a shorthand byte value to an integer byte value. 980 * 981 * @since 2.3.0 982 * @since 4.6.0 Moved from media.php to load.php 983 * 984 * @param string $size A shorthand byte value. 985 * @return int An integer byte value. 986 */ 987 function wp_convert_hr_to_bytes( $size ) { 988 $size = strtolower( $size ); 989 $bytes = (int) $size; 990 if ( strpos( $size, 'k' ) !== false ) 991 $bytes = intval( $size ) * KB_IN_BYTES; 992 elseif ( strpos( $size, 'm' ) !== false ) 993 $bytes = intval($size) * MB_IN_BYTES; 994 elseif ( strpos( $size, 'g' ) !== false ) 995 $bytes = intval( $size ) * GB_IN_BYTES; 996 return $bytes; 997 } -
trunk/src/wp-includes/media.php
r37986 r38012 2778 2778 2779 2779 /** 2780 * Converts a shorthand byte value to an integer byte value.2781 *2782 * @since 2.3.02783 *2784 * @param string $size A shorthand byte value.2785 * @return int An integer byte value.2786 */2787 function wp_convert_hr_to_bytes( $size ) {2788 $size = strtolower( $size );2789 $bytes = (int) $size;2790 if ( strpos( $size, 'k' ) !== false )2791 $bytes = intval( $size ) * KB_IN_BYTES;2792 elseif ( strpos( $size, 'm' ) !== false )2793 $bytes = intval($size) * MB_IN_BYTES;2794 elseif ( strpos( $size, 'g' ) !== false )2795 $bytes = intval( $size ) * GB_IN_BYTES;2796 return $bytes;2797 }2798 2799 /**2800 2780 * Determines the maximum upload size allowed in php.ini. 2801 2781 *
Note: See TracChangeset
for help on using the changeset viewer.