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

git-svn-id: https://develop.svn.wordpress.org/trunk@13095 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-02-13 07:09:04 +00:00
parent 68039969c1
commit 75705ed4c3
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>