WordPress.org

Make WordPress Core

Changeset 12911


Ignore:
Timestamp:
01/31/2010 12:23:50 PM (11 years ago)
Author:
dd32
Message:

Fix PHP Notices: Use checked() template function & initialise variables. s/WP/WordPress/ & some code formatting. See #11644

File:
1 edited

Legend:

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

    r12781 r12911  
    5252                ?>
    5353                <td>
    54                     <label><input name="registration" type="radio" id="registration1" value='none' <?php echo get_site_option('registration') == 'none' ? 'checked="checked"' : ''; ?> /> <?php _e('Disabled'); ?></label><br />
    55                     <label><input name="registration" type="radio" id="registration2" value='all' <?php echo get_site_option('registration') == 'all' ? 'checked="checked"' : ''; ?> /> <?php _e('Enabled. Blogs and user accounts can be created.'); ?></label><br />
    56                     <label><input name="registration" type="radio" id="registration3" value='user' <?php echo get_site_option('registration') == 'user' ? 'checked="checked"' : ''; ?> /> <?php _e('Only user account can be created.'); ?></label><br />
    57                     <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Only logged in users can create new blogs.'); ?></label><br />
     54                    <label><input name="registration" type="radio" id="registration1" value='none' <?php checked( get_site_option('registration'), 'none') ?> /> <?php _e('Disabled'); ?></label><br />
     55                    <label><input name="registration" type="radio" id="registration2" value='all' <?php  checked( get_site_option('registration'), 'all') ?> /> <?php _e('Enabled. Blogs and user accounts can be created.'); ?></label><br />
     56                    <label><input name="registration" type="radio" id="registration3" value='user' <?php checked( get_site_option('registration'), 'user') ?> /> <?php _e('Only user account can be created.'); ?></label><br />
     57                    <label><input name="registration" type="radio" id="registration4" value='blog' <?php checked( get_site_option('registration'), 'blog') ?> /> <?php _e('Only logged in users can create new blogs.'); ?></label><br />
    5858                    <p><?php _e('Disable or enable registration and who or what can be registered. (Default=all)'); ?></p>
    5959                    <?php if ( is_subdomain_install() ) {
    60                         echo "<p>" . __('If registration is disabled, please set "NOBLOGREDIRECT" in wp-config.php to a url you will redirect visitors to if they visit a non existant blog.') . "</p>";
     60                        echo '<p>' . __('If registration is disabled, please set "NOBLOGREDIRECT" in wp-config.php to a url you will redirect visitors to if they visit a non existant blog.') . '</p>';
    6161                    } ?>
    6262                </td>
     
    7070                ?>
    7171                <td>
    72                     <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes' <?php echo get_site_option('registrationnotification') == 'yes' ? 'checked="checked"' : ''; ?> /> <?php _e('Yes'); ?><br />
    73                     <input name="registrationnotification" type="radio" id="registrationnotification2" value='no' <?php echo get_site_option('registrationnotification') == 'no' ? 'checked="checked"' : ''; ?> /> <?php _e('No'); ?><br />
     72                    <input name="registrationnotification" type="radio" id="registrationnotification1" value='yes' <?php checked( get_site_option('registrationnotification'), 'yes') ?> /> <?php _e('Yes'); ?><br />
     73                    <input name="registrationnotification" type="radio" id="registrationnotification2" value='no' <?php checked( get_site_option('registrationnotification'), 'no') ?> /> <?php _e('No'); ?><br />
    7474                    <?php _e('Send the site admin an email notification every time someone registers a blog or user account.') ?>
    7575                </td>
     
    8080                <td>
    8181                    <a name='addnewusers'></a>
    82                     <input name="add_new_users" type="radio" id="add_new_users1" value='1' <?php echo get_site_option('add_new_users') == 1 ? 'checked="checked"' : ''; ?> /> <?php _e('Yes'); ?><br />
    83                     <input name="add_new_users" type="radio" id="add_new_users2" value='0' <?php echo get_site_option('add_new_users') == 0 ? 'checked="checked"' : ''; ?> /> <?php _e('No'); ?><br />
     82                    <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 />
    8484                    <?php _e('Allow blog administrators to add new users to their blog via the Users->Add New page.') ?>
    8585                </td>
     
    203203                <th scope="row"><?php _e('Upload media button') ?></th>
    204204                <?php $mu_media_buttons = get_site_option( 'mu_media_buttons', array() ); ?>
    205                 <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php if ( $mu_media_buttons[ 'image' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Images' ); ?></label><br />
    206                 <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php if ( $mu_media_buttons[ 'video' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Videos' ); ?></label><br />
    207                 <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php if ( $mu_media_buttons[ 'audio' ] ) { echo 'checked=checked '; } ?>/> <?php _e( 'Music' ); ?></label><br />
     205                <td><label><input type='checkbox' id="mu_media_buttons_image" name="mu_media_buttons[image]" value='1' <?php checked( !empty($mu_media_buttons[ 'image' ]) ) ?>/> <?php _e( 'Images' ); ?></label><br />
     206                <label><input type='checkbox' id="mu_media_buttons_video" name="mu_media_buttons[video]" value='1' <?php checked( !empty($mu_media_buttons[ 'video' ]) ) ?>/> <?php _e( 'Videos' ); ?></label><br />
     207                <label><input type='checkbox' id="mu_media_buttons_audio" name="mu_media_buttons[audio]" value='1' <?php checked( !empty($mu_media_buttons[ 'audio' ]) ) ?>/> <?php _e( 'Music' ); ?></label><br />
    208208                <?php _e( 'The media upload buttons to display on the "Write Post" page. Make sure you update the "Upload File Types" below as well.' ); ?></td>
    209209            </tr>
     
    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 if ( !get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Enabled' ); ?></label><br />
    214                 <label><input type='radio' id="upload_space_check_disabled" name="upload_space_check_disabled" value='1' <?php if ( get_site_option( 'upload_space_check_disabled' ) ) { echo 'checked=checked '; } ?>/> <?php _e( 'Disabled' ); ?></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' ), false ) ?>/> <?php _e( 'Enabled' ); ?></label><br />
     214                <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>
    216216            </tr>
     
    253253        <table class="form-table">
    254254            <?php
     255            $lang_files = array();
    255256            if ( is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) )
    256257                while( ( $lang_file = readdir( $dh ) ) !== false )
     
    258259                        $lang_files[] = $lang_file;
    259260            $lang = get_site_option('WPLANG');
    260             if ( is_array($lang_files) && !empty($lang_files) ) {
     261            if ( !empty($lang_files) ) {
    261262                ?>
    262263                <tr valign="top">
     
    273274        </table>
    274275
    275         <h3><?php _e('Menus <em>(Enable or disable WP Backend Menus)</em>') ?></h3>
     276        <h3><?php _e('Menus <em>(Enable or disable WordPress Backend Menus)</em>') ?></h3>
    276277        <table class="form-table">
    277278            <tr>
     
    281282            <a name='menu'></a>
    282283            <?php
    283             $menu_perms = get_site_option( "menu_items" );
     284            $menu_perms = get_site_option( 'menu_items' );
    284285            $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) );
    285286            foreach ( (array) $menu_items as $key => $val ) {
    286                 echo "<tr><th scope='row'>" . wp_specialchars($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . (( $menu_perms[$key] == '1' ) ? ' checked="checked"' : '') . " /></td></tr>";
     287                echo "<tr><th scope='row'>" . wp_specialchars($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . checked($menu_perms[$key], '1', false) . " /></td></tr>";
    287288            }
    288289            ?>
Note: See TracChangeset for help on using the changeset viewer.