Correctly save checkbox-style MS options and display "No" checked value correctly. See #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@13095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-02-13 07:09:04 +00:00
parent 14c0a033a5
commit 044cf9b83c
2 changed files with 7 additions and 2 deletions

View File

@ -102,6 +102,11 @@ switch ( $_GET['action'] ) {
}
update_site_option( "dashboard_blog", $dashboard_blog_id );
$options = array( 'registrationnotification', 'registration', 'add_new_users', 'menu_items', 'mu_media_buttons', 'upload_space_check_disabled', 'blog_upload_space', 'upload_filetypes', 'site_name', 'first_post', 'first_page', 'first_comment', 'first_comment_url', 'first_comment_author', 'welcome_email', 'welcome_user_email', 'fileupload_maxk', 'admin_notice_feed' );
$checked_options = array('mu_media_buttons', 'menu_items');
foreach ( $checked_options as $option_name ) {
if ( ! isset($_POST[ $option_name ]) )
$_POST[ $option_name ] = array();
}
foreach ( $options as $option_name ) {
if ( ! isset($_POST[ $option_name ]) )
continue;

View File

@ -80,7 +80,7 @@ if (isset($_GET['updated'])) {
<td>
<a name='addnewusers'></a>
<input name="add_new_users" type="radio" id="add_new_users1" value='1' <?php checked( get_site_option('add_new_users') ) ?> /> <?php _e('Yes'); ?><br />
<input name="add_new_users" type="radio" id="add_new_users2" value='0' <?php checked( get_site_option('add_new_users'), false) ?> /> <?php _e('No'); ?><br />
<input name="add_new_users" type="radio" id="add_new_users2" value='0' <?php checked( get_site_option('add_new_users'), 0) ?> /> <?php _e('No'); ?><br />
<?php _e('Allow blog administrators to add new users to their blog via the Users->Add New page.') ?>
</td>
</tr>
@ -210,7 +210,7 @@ if (isset($_GET['updated'])) {
<tr valign="top">
<th scope="row"><?php _e('Blog upload space check') ?></th>
<td>
<label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0' <?php checked( get_site_option( 'upload_space_check_disabled' ), false ) ?>/> <?php _e( 'Enabled' ); ?></label><br />
<label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='0' <?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php _e( 'Enabled' ); ?></label><br />
<label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1' <?php checked( get_site_option( 'upload_space_check_disabled' ) ) ?>/> <?php _e( 'Disabled' ); ?></label><br />
<?php _e( 'By default there is a limit on the total size of files uploaded but it can be disabled here.' ); ?></td>
</tr>