Changeset 9887 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
- Timestamp:
- 05/19/2020 08:14:31 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
r9886 r9887 202 202 /* translators: Maximum allowed file size. */ 203 203 esc_html__( 'Maximum allowed file size: %s', 'wporg-plugins' ), 204 esc_html( s elf::get_max_allowed_file_size() )204 esc_html( size_format( wp_max_upload_size() ) ) 205 205 ); 206 206 ?> … … 251 251 } 252 252 253 /**254 * Returns a human readable version of the max allowed upload size.255 *256 * @return string The allowed file size.257 */258 public static function get_max_allowed_file_size() {259 $upload_size_unit = wp_max_upload_size();260 261 $byte_sizes = array( 'KB', 'MB', 'GB' );262 263 for ( $unit = - 1; $upload_size_unit > 1024 && $unit < count( $byte_sizes ) - 1; $unit ++ ) {264 $upload_size_unit /= 1024;265 }266 267 if ( $unit < 0 ) {268 $upload_size_unit = $unit = 0;269 } else {270 $upload_size_unit = (int) $upload_size_unit;271 }272 273 return $upload_size_unit . $byte_sizes[ $unit ];274 }275 253 }
Note: See TracChangeset
for help on using the changeset viewer.