Make WordPress Core

Changeset 29030


Ignore:
Timestamp:
07/08/2014 05:51:58 PM (10 years ago)
Author:
johnbillion
Message:

Implement email and url input types where appropriate. Props Kau-Boy. Fixes #22183.

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/install.css

    r29021 r29030  
    153153
    154154.form-table input[type=text],
     155.form-table input[type=email],
     156.form-table input[type=url],
    155157.form-table input[type=password] {
    156158    width: 206px;
     
    296298
    297299    .form-table td input[type="text"],
     300    .form-table td input[type="email"],
     301    .form-table td input[type="url"],
    298302    .form-table td input[type="password"],
    299303    .form-table td select,
  • trunk/src/wp-admin/install.php

    r29020 r29030  
    9999<p class="message"><?php echo $error; ?></p>
    100100<?php } ?>
    101 <form id="setup" method="post" action="install.php?step=2">
     101<form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
    102102    <table class="form-table">
    103103        <tr>
     
    135135        <tr>
    136136            <th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th>
    137             <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
     137            <td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
    138138            <p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
    139139        </tr>
  • trunk/src/wp-admin/network/settings.php

    r27469 r29030  
    8686<div class="wrap">
    8787    <h2><?php echo esc_html( $title ); ?></h2>
    88     <form method="post" action="settings.php">
     88    <form method="post" action="settings.php" novalidate="novalidate">
    8989        <?php wp_nonce_field( 'siteoptions' ); ?>
    9090        <h3><?php _e( 'Operational Settings' ); ?></h3>
     
    100100                <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
    101101                <td>
    102                     <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
     102                    <input name="admin_email" type="email" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
    103103                    <p class="description">
    104104                        <?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
  • trunk/src/wp-admin/network/site-new.php

    r27469 r29030  
    120120        echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
    121121} ?>
    122 <form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>">
     122<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
    123123<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
    124124    <table class="form-table">
     
    141141        <tr class="form-field form-required">
    142142            <th scope="row"><?php _e( 'Admin Email' ) ?></th>
    143             <td><input name="blog[email]" type="text" class="regular-text wp-suggest-user" data-autocomplete-type="search" data-autocomplete-field="user_email" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
     143            <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" data-autocomplete-type="search" data-autocomplete-field="user_email" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
    144144        </tr>
    145145        <tr class="form-field">
  • trunk/src/wp-admin/options-general.php

    r29007 r29030  
    8787<h2><?php echo esc_html( $title ); ?></h2>
    8888
    89 <form method="post" action="options.php">
     89<form method="post" action="options.php" novalidate="novalidate">
    9090<?php settings_fields('general'); ?>
    9191
     
    103103<tr>
    104104<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
    105 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
     105<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
    106106</tr>
    107107<tr>
    108108<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
    109 <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
     109<td><input name="home" type="url" id="home" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
    110110<p class="description"><?php _e('Enter the address here if you want your site homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></p></td>
    111111</tr>
    112112<tr>
    113113<th scope="row"><label for="admin_email"><?php _e('E-mail Address') ?> </label></th>
    114 <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
     114<td><input name="admin_email" type="email" id="admin_email" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
    115115<p class="description"><?php _e('This address is used for admin purposes, like new user notification.') ?></p></td>
    116116</tr>
     
    131131<tr>
    132132<th scope="row"><label for="new_admin_email"><?php _e('E-mail Address') ?> </label></th>
    133 <td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
     133<td><input name="new_admin_email" type="email" id="new_admin_email" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
    134134<p class="description"><?php _e('This address is used for admin purposes. If you change this we will send you an e-mail at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></p>
    135135<?php
  • trunk/src/wp-admin/user-edit.php

    r28479 r29030  
    229229 */
    230230?>
    231 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action( 'user_edit_form_tag' ); ?>>
     231<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"<?php do_action( 'user_edit_form_tag' ); ?>>
    232232<?php wp_nonce_field('update-user_' . $user_id) ?>
    233233<?php if ( $wp_http_referer ) : ?>
     
    402402<tr>
    403403    <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
    404     <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text ltr" />
     404    <td><input type="email" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ) ?>" class="regular-text ltr" />
    405405    <?php
    406406    $new_email = get_option( $current_user->ID . '_new_email' );
     
    415415<tr>
    416416    <th><label for="url"><?php _e('Website') ?></label></th>
    417     <td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td>
     417    <td><input type="url" name="url" id="url" value="<?php echo esc_attr( $profileuser->user_url ) ?>" class="regular-text code" /></td>
    418418</tr>
    419419
  • trunk/src/wp-admin/user-new.php

    r29009 r29030  
    275275        echo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';
    276276        $label = __('E-mail');
     277        $type  = 'email';
    277278    } else {
    278279        echo '<p>' . __( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>';
    279280        $label = __('E-mail or Username');
     281        $type  = 'text';
    280282    }
    281283?>
     
    287289 */
    288290?>
    289 <form action="" method="post" name="adduser" id="adduser" class="validate"<?php do_action( 'user_new_form_tag' );?>>
     291<form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
    290292<input name="action" type="hidden" value="adduser" />
    291293<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
     
    294296    <tr class="form-field form-required">
    295297        <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
    296         <td><input name="email" type="text" id="adduser-email" class="wp-suggest-user" value="" /></td>
     298        <td><input name="email" type="<?php echo $type; ?>" id="adduser-email" class="wp-suggest-user" value="" /></td>
    297299    </tr>
    298300    <tr class="form-field">
     
    335337<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
    336338<?php /** This action is documented in wp-admin/user-new.php */ ?>
    337 <form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action( 'user_new_form_tag' );?>>
     339<form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
    338340<input name="action" type="hidden" value="createuser" />
    339341<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
     
    359361    <tr class="form-field form-required">
    360362        <th scope="row"><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
    361         <td><input name="email" type="text" id="email" value="<?php echo esc_attr($new_user_email); ?>" /></td>
     363        <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td>
    362364    </tr>
    363365<?php if ( !is_multisite() ) { ?>
     
    372374    <tr class="form-field">
    373375        <th scope="row"><label for="url"><?php _e('Website') ?></label></th>
    374         <td><input name="url" type="text" id="url" class="code" value="<?php echo esc_attr($new_user_uri); ?>" /></td>
     376        <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td>
    375377    </tr>
    376378<?php
  • trunk/src/wp-login.php

    r28925 r29030  
    682682?>
    683683
    684 <form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post">
     684<form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post" novalidate="novalidate">
    685685    <p>
    686686        <label for="user_login"><?php _e('Username') ?><br />
     
    689689    <p>
    690690        <label for="user_email"><?php _e('E-mail') ?><br />
    691         <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label>
     691        <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
    692692    </p>
    693693    <?php
  • trunk/src/wp-signup.php

    r28447 r29030  
    189189        <p class="error"><?php echo $errmsg ?></p>
    190190    <?php } ?>
    191     <input name="user_email" type="text" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('We send your registration email to this address. (Double-check your email address before continuing.)') ?>
     191    <input name="user_email" type="email" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('We send your registration email to this address. (Double-check your email address before continuing.)') ?>
    192192    <?php
    193193    if ( $errmsg = $errors->get_error_message('generic') ) {
     
    436436
    437437    <h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2>
    438     <form id="setupform" method="post" action="wp-signup.php">
     438    <form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate">
    439439        <input type="hidden" name="stage" value="validate-user-signup" />
    440440        <?php
Note: See TracChangeset for help on using the changeset viewer.