0

I want to write a wordpress plugin that custom the wp admin login form. I want to add a hidden type input to the form. please guide me to do this. thanks

  • Please provide more information - show us your plugin code and what you've done so far. WP Stack Exchange is intended to answer specific technical questions for users. What you've done here is basically ask for someone to provide you with a tutorial. Tutorials like this already exist: pippinsplugins.com/… – Tony Djukic May 18 at 14:21
0

You can hook the login_form action:

/**
 * Fires following the 'Password' field in the login form.
 *
 * @since 2.1.0
 */
do_action( 'login_form' );

which is called between the password box and the 'remember me?' checkbox, and write out your hidden input field there, e.g.

function wpse_366921_hidden_login_field() {
    ?>
    <input type="hidden" name="hidden-login-field" value="1" />
    <?php
}
add_action( 'login_form', 'wpse_366921_hidden_login_field', 10, 0 );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.