Make WordPress Core

Ticket #37331: 37331-3.diff

File 37331-3.diff, 3.7 KB (added by rianrietveld, 7 years ago)

adds required asterisk and required attribute

  • src/wp-admin/network/site-new.php

     
    212212        }
    213213}
    214214?>
     215<?php echo sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' ); ?>
    215216<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
    216217<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
    217218        <table class="form-table">
    218219                <tr class="form-field form-required">
    219                         <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?></label></th>
     220                        <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th>
    220221                        <td>
    221222                        <?php if ( is_subdomain_install() ) { ?>
    222                                 <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
     223                                <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required="required"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
    223224                        <?php
    224225} else {
    225226        echo get_network()->domain . get_network()->path
    226227        ?>
    227                                 <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc"  autocapitalize="none" autocorrect="off" />
     228                                <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required="required"/>
    228229<?php
    229230}
    230231                        echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
     
    232233                        </td>
    233234                </tr>
    234235                <tr class="form-field form-required">
    235                         <th scope="row"><label for="site-title"><?php _e( 'Site Title' ); ?></label></th>
    236                         <td><input name="blog[title]" type="text" class="regular-text" id="site-title" /></td>
     236                        <th scope="row"><label for="site-title"><?php _e( 'Site Title' ); ?> <span class="required">*</span></label></th>
     237                        <td><input name="blog[title]" type="text" class="regular-text" id="site-title" required="required"/></td>
    237238                </tr>
    238239                <?php
    239240                $languages    = get_available_languages();
     
    267268                        </tr>
    268269                <?php endif; // Languages. ?>
    269270                <tr class="form-field form-required">
    270                         <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ); ?></label></th>
    271                         <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" /></td>
     271                        <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ); ?> <span class="required">*</span></label></th>
     272                        <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required="required"/></td>
    272273                </tr>
    273274                <tr class="form-field">
    274                         <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></td>
     275                        <td colspan="2"><p id="site-admin-email"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td>
    275276                </tr>
    276277        </table>
    277278