Changeset 9887
- Timestamp:
- 05/19/2020 08:14:31 PM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 2 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 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/upload.php
r9725 r9887 48 48 <button id="upload_button" class="button" type="submit" value="' . esc_attr__( 'Upload', 'wporg-themes' ) . '">' . esc_html__( 'Upload', 'wporg-themes' ) . '</button> 49 49 <p> 50 <small>' . sprintf( __( 'Maximum allowed file size: %s', 'wporg-themes' ), esc_html( wporg_themes_get_max_allowed_file_size() ) ) . '</small>50 <small>' . sprintf( __( 'Maximum allowed file size: %s', 'wporg-themes' ), esc_html( size_format( wp_max_upload_size() ) ) ) . '</small> 51 51 </p> 52 52 </form>'; 53 53 54 54 return $notice . $form; 55 }56 57 /**58 * Returns a human readable version of the max allowed upload size.59 *60 * @return string The allowed file size.61 */62 function wporg_themes_get_max_allowed_file_size() {63 $upload_size_unit = wp_max_upload_size();64 $byte_sizes = array( 'KB', 'MB', 'GB' );65 66 for ( $unit = - 1; $upload_size_unit > 1024 && $unit < count( $byte_sizes ) - 1; $unit++ ) {67 $upload_size_unit /= 1024;68 }69 if ( $unit < 0 ) {70 $upload_size_unit = $unit = 0;71 } else {72 $upload_size_unit = (int) $upload_size_unit;73 }74 return $upload_size_unit . $byte_sizes[ $unit ];75 55 } 76 56
Note: See TracChangeset
for help on using the changeset viewer.