Adding Extra Registration Fields and Validate the new fields on NETWORK
-
Hello,
in a previous work I successfully added a checkbox to the registration form as described in the documentation:
https://www.jfarthing.com/development/theme-my-login/adding-extra-registration-fields/So, I used this code:
register-form.php<textarea id="disclaimer<?php $template->the_instance(); ?>"><?php include('disclaimer.txt'); ?></textarea><br /> <input type="checkbox" name="acceptdisclaimer" id="acceptdisclaimer<?php $template->the_instance(); ?>" /> ACCEPT
theme-my-login-custom.php
function tml_register_errors( $errors ) { if ( !$_POST['acceptdisclaimer'] ) $errors->add( 'no_disclaimer', '<strong>ERROR</strong>: NO DISCLAIMER' ); return $errors; } add_filter( 'registration_errors', 'tml_register_errors' );
And it works fine!
Now, I need to implement this on a wordpress network!
The previous code doesn’t work.
So, I’m trying this code:ms-signup-user-form.php
<textarea id="disclaimer<?php $template->the_instance(); ?>"><?php include('disclaimer.txt'); ?></textarea><br /> <input type="checkbox" name="acceptdisclaimer" id="acceptdisclaimer<?php $template->the_instance(); ?>" /> ACCEPT
theme-my-login-custom.php
function tml_validate_user_signup ( $result ) { if ( !$_POST['acceptdisclaimer'] ) { $result['errors']->add('no_disclaimer', "NO DISCLAIMER"); } return $result; } add_filter('wpmu_validate_user_signup', 'tml_validate_user_signup', 10, 3);
It doesn’t seem to work either… (Checkbox added, but no error if it is not checked)
Any help?
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Adding Extra Registration Fields and Validate the new fields on NETWORK’ is closed to new replies.