Ticket #42053: 42053.diff
File 42053.diff, 2.5 KB (added by , 7 years ago) |
---|
-
src/wp-includes/general-template.php
403 403 'id_submit' => 'wp-submit', 404 404 'remember' => true, 405 405 'value_username' => '', 406 // Set 'input_username_required' to true will make username input field required 407 'input_username_required' => false, 408 // Set 'input_password_required' to true will make password input field required 409 'input_password_required' => false, 406 410 // Set 'value_remember' to true to default the "Remember me" checkbox to checked. 407 411 'value_remember' => false, 408 412 ); … … 455 459 */ 456 460 $login_form_bottom = apply_filters( 'login_form_bottom', '', $args ); 457 461 462 // If username input field is required. 463 $input_username_required = $args['input_username_required'] ? 'required' : ''; 464 // If password input field is required. 465 $input_password_required = $args['input_password_required'] ? 'required' : ''; 466 458 467 $form = ' 459 468 <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '" method="post"> 460 469 ' . $login_form_top . ' 461 470 <p class="login-username"> 462 471 <label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label> 463 <input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" />472 <input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" ' . esc_attr( $input_username_required ) . '/> 464 473 </p> 465 474 <p class="login-password"> 466 475 <label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label> 467 <input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" />476 <input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" ' . esc_attr( $input_password_required ) . '/> 468 477 </p> 469 478 ' . $login_form_middle . ' 470 479 ' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '