Make WordPress Core

Ticket #28528: wp-login-enhancements.diff

File wp-login-enhancements.diff, 4.2 KB (added by SGr33n, 9 years ago)
  • wp-login.php

     
    521521        login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '</p>', $errors);
    522522
    523523        $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : '';
    524 
     524       
     525        $user_or_email_field = '<input type="text" name="user_login" id="user_login" class="input" value="'. esc_attr($user_login) .'" size="20" />';
     526        $user_or_email_field = apply_filters( 'user_or_email_field', $user_or_email_field );
    525527?>
    526528
    527529<form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
    528530        <p>
    529531                <label for="user_login" ><?php _e('Username or Email:') ?><br />
    530                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label>
     532                <?php echo $user_or_email_field; ?></label>
    531533        </p>
    532534        <?php
    533535        /**
     
    616618
    617619?>
    618620<form name="resetpassform" id="resetpassform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=resetpass', 'login_post' ) ); ?>" method="post" autocomplete="off">
     621       
     622        <?php do_action( 'before_resetpass_form_fields' ); ?>
     623
    619624        <input type="hidden" id="user_login" value="<?php echo esc_attr( $rp_login ); ?>" autocomplete="off" />
    620625
    621626        <div class="user-pass1-wrap">
     
    710715         */
    711716        $redirect_to = apply_filters( 'registration_redirect', $registration_redirect );
    712717        login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
     718       
     719        $register_user_field = '<input type="text" name="user_login" id="user_login" class="input" value="'. esc_attr( wp_unslash( $user_login ) ) .'" size="20" />';
     720        $register_user_field = apply_filters( 'register_user_field', $register_user_field );
     721       
     722        $register_email_field = '<input type="email" name="user_email" id="user_email" class="input" value="' . esc_attr( wp_unslash( $user_email ) ) .'" size="25" />';
     723        $register_email_field = apply_filters( 'register_email_field', $register_email_field );
    713724?>
    714725
    715726<form name="registerform" id="registerform" action="<?php echo esc_url( wp_registration_url() ); ?>" method="post" novalidate="novalidate">
     727
     728        <?php do_action( 'before_register_form_fields' ); ?>
     729
    716730        <p>
    717731                <label for="user_login"><?php _e('Username') ?><br />
    718                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label>
     732                <?php echo $register_user_field; ?></label>
    719733        </p>
    720734        <p>
    721735                <label for="user_email"><?php _e('Email') ?><br />
    722                 <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
     736                <?php echo $register_email_field; ?></label>
    723737        </p>
    724738        <?php
    725739        /**
     
    876890        } else {
    877891                $aria_describedby_error = '';
    878892        }
     893       
     894        $user_login_field = '<input type="text" name="log" id="user_login"'. $aria_describedby_error .' class="input" value="'. esc_attr( $user_login ). '" size="20" />';
     895        $user_login_field = apply_filters( 'user_login_field', $user_login_field );
     896       
     897        $user_pass_field = '<input type="password" name="pwd" id="user_pass"'. $aria_describedby_error .' class="input" value="" size="20" />';
     898        $user_pass_field = apply_filters( 'user_pass_field', $user_pass_field );
    879899?>
    880900
    881901<form name="loginform" id="loginform" action="<?php echo esc_url( wp_login_url() ); ?>" method="post">
     902
     903        <?php do_action( 'before_login_form_fields' ); ?>
     904
    882905        <p>
    883906                <label for="user_login"><?php _e('Username') ?><br />
    884                 <input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label>
     907                <?php echo $user_login_field; ?></label>
    885908        </p>
    886909        <p>
    887910                <label for="user_pass"><?php _e('Password') ?><br />
    888                 <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label>
     911                <?php echo $user_pass_field; ?></label>
    889912        </p>
    890913        <?php
    891914        /**