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

Built from https://develop.svn.wordpress.org/trunk@29030


git-svn-id: http://core.svn.wordpress.org/trunk@28818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-07-08 17:52:14 +00:00
parent 57dbc55e6e
commit be12ea968a
12 changed files with 35 additions and 25 deletions

View File

@ -152,6 +152,8 @@ submit {
} }
.form-table input[type=text], .form-table input[type=text],
.form-table input[type=email],
.form-table input[type=url],
.form-table input[type=password] { .form-table input[type=password] {
width: 206px; width: 206px;
} }
@ -295,6 +297,8 @@ body.rtl,
} }
.form-table td input[type="text"], .form-table td input[type="text"],
.form-table td input[type="email"],
.form-table td input[type="url"],
.form-table td input[type="password"], .form-table td input[type="password"],
.form-table td select, .form-table td select,
.form-table td textarea, .form-table td textarea,

File diff suppressed because one or more lines are too long

View File

@ -152,6 +152,8 @@ submit {
} }
.form-table input[type=text], .form-table input[type=text],
.form-table input[type=email],
.form-table input[type=url],
.form-table input[type=password] { .form-table input[type=password] {
width: 206px; width: 206px;
} }
@ -295,6 +297,8 @@ body.rtl,
} }
.form-table td input[type="text"], .form-table td input[type="text"],
.form-table td input[type="email"],
.form-table td input[type="url"],
.form-table td input[type="password"], .form-table td input[type="password"],
.form-table td select, .form-table td select,
.form-table td textarea, .form-table td textarea,

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@ function display_setup_form( $error = null ) {
?> ?>
<p class="message"><?php echo $error; ?></p> <p class="message"><?php echo $error; ?></p>
<?php } ?> <?php } ?>
<form id="setup" method="post" action="install.php?step=2"> <form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
<table class="form-table"> <table class="form-table">
<tr> <tr>
<th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th> <th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th>
@ -134,7 +134,7 @@ function display_setup_form( $error = null ) {
<?php endif; ?> <?php endif; ?>
<tr> <tr>
<th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th> <th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th>
<td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" /> <td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
<p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td> <p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
</tr> </tr>
<tr> <tr>

View File

@ -85,7 +85,7 @@ if ( isset( $_GET['updated'] ) ) {
<div class="wrap"> <div class="wrap">
<h2><?php echo esc_html( $title ); ?></h2> <h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="settings.php"> <form method="post" action="settings.php" novalidate="novalidate">
<?php wp_nonce_field( 'siteoptions' ); ?> <?php wp_nonce_field( 'siteoptions' ); ?>
<h3><?php _e( 'Operational Settings' ); ?></h3> <h3><?php _e( 'Operational Settings' ); ?></h3>
<table class="form-table"> <table class="form-table">
@ -99,7 +99,7 @@ if ( isset( $_GET['updated'] ) ) {
<tr> <tr>
<th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th> <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
<td> <td>
<input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" /> <input name="admin_email" type="email" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
<p class="description"> <p class="description">
<?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?> <?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
</p> </p>

View File

@ -119,7 +119,7 @@ if ( ! empty( $messages ) ) {
foreach ( $messages as $msg ) foreach ( $messages as $msg )
echo '<div id="message" class="updated"><p>' . $msg . '</p></div>'; echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
} ?> } ?>
<form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>"> <form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?> <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
<table class="form-table"> <table class="form-table">
<tr class="form-field form-required"> <tr class="form-field form-required">
@ -140,7 +140,7 @@ if ( ! empty( $messages ) ) {
</tr> </tr>
<tr class="form-field form-required"> <tr class="form-field form-required">
<th scope="row"><?php _e( 'Admin Email' ) ?></th> <th scope="row"><?php _e( 'Admin Email' ) ?></th>
<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> <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>
</tr> </tr>
<tr class="form-field"> <tr class="form-field">
<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 password will be mailed to this email address.' ) ?></td> <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 password will be mailed to this email address.' ) ?></td>

View File

@ -86,7 +86,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<div class="wrap"> <div class="wrap">
<h2><?php echo esc_html( $title ); ?></h2> <h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php"> <form method="post" action="options.php" novalidate="novalidate">
<?php settings_fields('general'); ?> <?php settings_fields('general'); ?>
<table class="form-table"> <table class="form-table">
@ -102,16 +102,16 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<?php if ( !is_multisite() ) { ?> <?php if ( !is_multisite() ) { ?>
<tr> <tr>
<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th> <th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
<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> <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>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th> <th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
<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' ?>" /> <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' ?>" />
<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> <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>
</tr> </tr>
<tr> <tr>
<th scope="row"><label for="admin_email"><?php _e('E-mail Address') ?> </label></th> <th scope="row"><label for="admin_email"><?php _e('E-mail Address') ?> </label></th>
<td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" /> <td><input name="admin_email" type="email" id="admin_email" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
<p class="description"><?php _e('This address is used for admin purposes, like new user notification.') ?></p></td> <p class="description"><?php _e('This address is used for admin purposes, like new user notification.') ?></p></td>
</tr> </tr>
<tr> <tr>
@ -130,7 +130,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<?php } else { ?> <?php } else { ?>
<tr> <tr>
<th scope="row"><label for="new_admin_email"><?php _e('E-mail Address') ?> </label></th> <th scope="row"><label for="new_admin_email"><?php _e('E-mail Address') ?> </label></th>
<td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" /> <td><input name="new_admin_email" type="email" id="new_admin_email" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
<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> <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>
<?php <?php
$new_admin_email = get_option( 'new_admin_email' ); $new_admin_email = get_option( 'new_admin_email' );

View File

@ -228,7 +228,7 @@ if ( ! IS_PROFILE_PAGE ) {
* @since 3.0.0 * @since 3.0.0
*/ */
?> ?>
<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' ); ?>> <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' ); ?>>
<?php wp_nonce_field('update-user_' . $user_id) ?> <?php wp_nonce_field('update-user_' . $user_id) ?>
<?php if ( $wp_http_referer ) : ?> <?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" /> <input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
@ -401,7 +401,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
<table class="form-table"> <table class="form-table">
<tr> <tr>
<th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
<td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text ltr" /> <td><input type="email" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ) ?>" class="regular-text ltr" />
<?php <?php
$new_email = get_option( $current_user->ID . '_new_email' ); $new_email = get_option( $current_user->ID . '_new_email' );
if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?> if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
@ -414,7 +414,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
<tr> <tr>
<th><label for="url"><?php _e('Website') ?></label></th> <th><label for="url"><?php _e('Website') ?></label></th>
<td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td> <td><input type="url" name="url" id="url" value="<?php echo esc_attr( $profileuser->user_url ) ?>" class="regular-text code" /></td>
</tr> </tr>
<?php <?php

View File

@ -274,9 +274,11 @@ if ( is_multisite() ) {
if ( !is_super_admin() ) { if ( !is_super_admin() ) {
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>'; 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>';
$label = __('E-mail'); $label = __('E-mail');
$type = 'email';
} else { } else {
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>'; 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>';
$label = __('E-mail or Username'); $label = __('E-mail or Username');
$type = 'text';
} }
?> ?>
<?php <?php
@ -286,14 +288,14 @@ if ( is_multisite() ) {
* @since 3.0.0 * @since 3.0.0
*/ */
?> ?>
<form action="" method="post" name="adduser" id="adduser" class="validate"<?php do_action( 'user_new_form_tag' );?>> <form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
<input name="action" type="hidden" value="adduser" /> <input name="action" type="hidden" value="adduser" />
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?> <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
<table class="form-table"> <table class="form-table">
<tr class="form-field form-required"> <tr class="form-field form-required">
<th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th> <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
<td><input name="email" type="text" id="adduser-email" class="wp-suggest-user" value="" /></td> <td><input name="email" type="<?php echo $type; ?>" id="adduser-email" class="wp-suggest-user" value="" /></td>
</tr> </tr>
<tr class="form-field"> <tr class="form-field">
<th scope="row"><label for="adduser-role"><?php _e('Role'); ?></label></th> <th scope="row"><label for="adduser-role"><?php _e('Role'); ?></label></th>
@ -334,7 +336,7 @@ if ( current_user_can( 'create_users') ) {
?> ?>
<p><?php _e('Create a brand new user and add them to this site.'); ?></p> <p><?php _e('Create a brand new user and add them to this site.'); ?></p>
<?php /** This action is documented in wp-admin/user-new.php */ ?> <?php /** This action is documented in wp-admin/user-new.php */ ?>
<form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action( 'user_new_form_tag' );?>> <form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
<input name="action" type="hidden" value="createuser" /> <input name="action" type="hidden" value="createuser" />
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?> <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
<?php <?php
@ -358,7 +360,7 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unsl
</tr> </tr>
<tr class="form-field form-required"> <tr class="form-field form-required">
<th scope="row"><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> <th scope="row"><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
<td><input name="email" type="text" id="email" value="<?php echo esc_attr($new_user_email); ?>" /></td> <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td>
</tr> </tr>
<?php if ( !is_multisite() ) { ?> <?php if ( !is_multisite() ) { ?>
<tr class="form-field"> <tr class="form-field">
@ -371,7 +373,7 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unsl
</tr> </tr>
<tr class="form-field"> <tr class="form-field">
<th scope="row"><label for="url"><?php _e('Website') ?></label></th> <th scope="row"><label for="url"><?php _e('Website') ?></label></th>
<td><input name="url" type="text" id="url" class="code" value="<?php echo esc_attr($new_user_uri); ?>" /></td> <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td>
</tr> </tr>
<?php <?php
/** /**

View File

@ -681,14 +681,14 @@ case 'register' :
login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors); login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
?> ?>
<form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post"> <form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post" novalidate="novalidate">
<p> <p>
<label for="user_login"><?php _e('Username') ?><br /> <label for="user_login"><?php _e('Username') ?><br />
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label> <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label>
</p> </p>
<p> <p>
<label for="user_email"><?php _e('E-mail') ?><br /> <label for="user_email"><?php _e('E-mail') ?><br />
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label> <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
</p> </p>
<?php <?php
/** /**

View File

@ -188,7 +188,7 @@ function show_user_form($user_name = '', $user_email = '', $errors = '') {
<?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?> <?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?>
<p class="error"><?php echo $errmsg ?></p> <p class="error"><?php echo $errmsg ?></p>
<?php } ?> <?php } ?>
<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.)') ?> <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.)') ?>
<?php <?php
if ( $errmsg = $errors->get_error_message('generic') ) { if ( $errmsg = $errors->get_error_message('generic') ) {
echo '<p class="error">' . $errmsg . '</p>'; echo '<p class="error">' . $errmsg . '</p>';
@ -435,7 +435,7 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
?> ?>
<h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2> <h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2>
<form id="setupform" method="post" action="wp-signup.php"> <form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate">
<input type="hidden" name="stage" value="validate-user-signup" /> <input type="hidden" name="stage" value="validate-user-signup" />
<?php <?php
/** This action is documented in wp-signup.php */ /** This action is documented in wp-signup.php */