Adding a “Security Question” to multisite registration page
-
I want to add a security question to the registration page.
I found a code snippet that works very well on non-multisites:
add_action( 'register_form', 'add_register_field' ); function add_register_field() { ?> <p> <label><?php _e('What is the name of the ship in the TV show Firefly?') ?><br /> <input type="text" name="user_proof" id="user_proof" class="input" size="25" tabindex="20" /></label> </p> <?php } add_action( 'register_post', 'add_register_field_validate', 10, 3 ); function add_register_field_validate( $sanitized_user_login, $user_email, $errors) { if (!isset($_POST[ 'user_proof' ]) || empty($_POST[ 'user_proof' ])) { return $errors->add( 'proofempty', '<strong>ERROR</strong>: You did not answer the proof-of-humanship question.' ); } elseif ( strtolower( $_POST[ 'user_proof' ] ) != 'serenity' ) { return $errors->add( 'prooffail', '<strong>ERROR</strong>: You did not answer the proof-of-humanship question correctly.' ); } }
I know that “register_form” should be replaced by “signup_extra_fields” and I think “register_post” should be replaced by “wpmu_validate_blog_signup”, but all I get is a blank page when I try to submit it. I am not sure how to use the wpmu_validate_blog_signup function properly.
Can someone tell me what I need to change to make it work?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding a “Security Question” to multisite registration page’ is closed to new replies.