show_user_form() – Displays the fields for the new user account registration form.

You appear to be a bot. Output may be restricted

Description

Displays the fields for the new user account registration form.

Usage

show_user_form( $user_name, $user_email, $errors );

Parameters

$user_name
( string ) optional – The entered username.
$user_email
( string ) optional – The entered email address.
$errors
( WP_Error|string ) optional – A WP_Error object containing existing errors. Defaults to empty string.

Returns

void

Source

File name: wordpress/wp-signup.php


Lines:

1 to 39 of 39
function show_user_form( $user_name = '', $user_email = '', $errors = '' ) {
  if ( ! is_wp_error( $errors ) ) {
    $errors = new WP_Error();
  }

  // Username.
  echo '<label for="user_name">' . __( 'Username:' ) . '</label>';
  $errmsg = $errors->get_error_message( 'user_name' );
  if ( $errmsg ) {
    echo '<p class="error">' . $errmsg . '</p>';
  }
  echo '<input name="user_name" type="text" id="user_name" value="' . esc_attr( $user_name ) . '" autocapitalize="none" autocorrect="off" maxlength="60" autocomplete="username" /><br />';
  _e( '(Must be at least 4 characters, letters and numbers only.)' );
  ?>

	<label for="user_email"><?php _e( 'Email&nbsp;Address:' ); ?></label>
	<?php
  $errmsg = $errors->get_error_message( 'user_email' );
  if ( $errmsg ) {
    ?>
		<p class="error"><?php echo $errmsg; ?></p>
	<?php } ?>
	<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" autocomplete="email" /><br /><?php _e( 'Your registration email is sent to this address. (Double-check your email address before continuing.)' ); ?>
	<?php
  $errmsg = $errors->get_error_message( 'generic' );
  if ( $errmsg ) {
    echo '<p class="error">' . $errmsg . '</p>';
  }
  
/**
 * Fires at the end of the new user account registration form.
 *
 * @since 3.0.0
 *
 * @param WP_Error $errors A WP_Error object containing 'user_name' or 'user_email' errors.
 */
  do_action( 'signup_extra_fields', $errors );
}
 

 View on GitHub View on Trac