TML Registration Error Message
-
Hi Jeff,
1. When enabling the Custom Password module, is there any way we can change the order in which the fields appear in the registration form ? For example, mine show underneath a particular section when whey should ideally be in the same TML block before any other plugin injects code
2. I looked at function password_errors in custom-passwords.php hoping to be able to leverage it and change the default “ERROR” messages. Whilst this does work, the original “ERROR” message is displayed.
As an example
function tml_registration_errors( $errors ) {
// Make sure passwords aren’t empty
if ( empty( $_POST[‘pass1’] ) || empty( $_POST[‘pass2′] ) )
$errors->add( ’empty_password’, ‘<i class=”fa fa-exclamation-triangle tml-tab-right”></i>Please enter your password twice,’ );
if ( empty( $_POST[‘first_name’] ) )
$errors->add( ’empty_first_name’, ‘<i class=”fa fa-exclamation-triangle tml-tab-right”></i>Please enter your first name.’ );
if ( empty( $_POST[‘last_name’] ) )
$errors->add( ’empty_last_name’, ‘<i class=”fa fa-exclamation-triangle tml-tab-right”></i>Please enter your last name.’ );
if ( empty( $_POST[‘user_login’] ) )
$errors->add( ’empty_user_login’, ‘<i class=”fa fa-exclamation-triangle tml-tab-right”></i>Please enter your username.’ );
if ( !isset( $_POST[‘privacy_check’] ) )
$errors->add( ’empty_last_name’, ‘<i class=”fa fa-exclamation-triangle tml-tab-right”></i>You must review and accept the privacy policy.’ );
return $errors;
}
add_filter( ‘registration_errors’, ‘tml_registration_errors’ );Any advice please ?
Thanks
- The topic ‘TML Registration Error Message’ is closed to new replies.