• Resolved Mark Cutting

    (@mcutting)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Mark Cutting

    (@mcutting)

    @jfarthing84 can you assist when you have a moment please ?

    Thanks

    Plugin Author Jeff Farthing

    (@jfarthing84)

    1. You could remove TML’s callback and attach it with a different priority. Alternatively, you could remove TML’s callback and manually add the fields to the form where you want them.
    2. You will need to remove TML’s callback that is attached to registration_errors.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘TML Registration Error Message’ is closed to new replies.