WordPress.org

Make WordPress Core

Changeset 13095


Ignore:
Timestamp:
02/13/2010 07:09:04 AM (10 years ago)
Author:
dd32
Message:

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

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-edit.php

    r12978 r13095  
    103103        update_site_option( "dashboard_blog", $dashboard_blog_id );
    104104        $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' );
     105        $checked_options = array('mu_media_buttons', 'menu_items');
     106        foreach ( $checked_options as $option_name ) {
     107            if ( ! isset($_POST[ $option_name ]) )
     108                $_POST[ $option_name ] = array();
     109        }
    105110        foreach ( $options as $option_name ) {
    106111            if ( ! isset($_POST[ $option_name ]) )
  • trunk/wp-admin/ms-options.php

    r12978 r13095  
    8181                    <a name='addnewusers'></a>
    8282                    <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 />
    83                     <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 />
     83                    <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 />
    8484                    <?php _e('Allow blog administrators to add new users to their blog via the Users->Add New page.') ?>
    8585                </td>
     
    211211                <th scope="row"><?php _e('Blog upload space check') ?></th>
    212212                <td>
    213                 <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 />
     213                <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 />
    214214                <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 />
    215215                <?php _e( 'By default there is a limit on the total size of files uploaded but it can be disabled here.' ); ?></td>
Note: See TracChangeset for help on using the changeset viewer.