Make WordPress Core

Ticket #27224: 27224.diff

File 27224.diff, 1.3 KB (added by bansod_deven, 10 years ago)

Changed the indicators to MB

  • settings.php

     
    6161        foreach ( $options as $option_name ) {
    6262                if ( ! isset($_POST[$option_name]) )
    6363                        continue;
    64                 $value = wp_unslash( $_POST[$option_name] );
     64                if ( $option_name == 'fileupload_maxk' ) {
     65                       
     66                        $value = (float)wp_unslash($_POST[$option_name]) * 1024;
     67                       
     68                }
     69               
     70                else {
     71
     72                        $value = wp_unslash( $_POST[$option_name] );
     73                       
     74                }
    6575                update_site_option( $option_name, $value );
     76               
    6677        }
    6778
     79
    6880        /**
    6981         * Fires after the network options are updated.
    7082         *
     
    269281
    270282                        <tr>
    271283                                <th scope="row"><label for="fileupload_maxk"><?php _e( 'Max upload file size' ) ?></label></th>
    272                                 <td><?php printf( _x( '%s KB', 'File size in kilobytes' ), '<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />' ); ?></td>
     284                                <td><?php printf( _x( '%s MB', 'File size in MB' ), '<input name="fileupload_maxk" type="number" min="0" step="0.001" style="width: 100px" id="fileupload_maxk" value="' . round( esc_attr( get_site_option( 'fileupload_maxk', 300 )/1024 ), 3) . '" />' ); ?></td>
    273285                        </tr>
    274286                </table>
    275287