• Resolved kalleaume

    (@kalleaume)


    I have looked through the documentation and could not see how to remove the ‘Confirm password’ field from the registration form. I tried the instructions in the ‘Removing Profile Fields’ documentation’, but this code did not work:

    function remove_tml_profile_fields() {
    tml_remove_form_field( ‘profile’, ‘pass2’ );
    }
    add_action( ‘init’, ‘remove_tml_profile_fields’ );

    Can you please advise how we can remove this and only have the user enter their password once?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    function remove_tml_registration_fields() {
        tml_remove_form_field( 'register', 'pass2' );
    }
    add_action( 'init', 'remove_tml_registration_fields' );
    Thread Starter kalleaume

    (@kalleaume)

    Thank you very much for your reply. Could you please tell me where I should add this code, and if there is another step required?

    I have followed the instructions here to add fields to my form, and this has worked successfully using the ‘Code snippets plugin. So I tried adding your code above for removing the ‘Confirm password’ field by inserting you code above this code in the snippet:

    function add_tml_registration_form_fields() {
    	tml_add_form_field( 'register', 'first_name', array(
    		'type'     => 'text',
    		'label'    => 'First Name',
    		'value'    => tml_get_request_value( 'first_name', 'post' ),
    		'id'       => 'first_name',
    		'priority' => 15,
    	) );
    	tml_add_form_field( 'register', 'last_name', array(
    		'type'     => 'text',
    		'label'    => 'Last Name',
    		'value'    => tml_get_request_value( 'last_name', 'post' ),
    		'id'       => 'last_name',
    		'priority' => 15,
    	) );
    		tml_add_form_field( 'register', 'company', array(
    		'type'     => 'text',
    		'label'    => 'Organisation',
    		'value'    => tml_get_request_value( 'company', 'post' ),
    		'id'       => 'company',
    		'priority' => 15,
    	) );
    }
    add_action( 'init', 'add_tml_registration_form_fields' );
    

    But it did not remove the ‘Confirm password’ field and simply erased the extra fields that I had added. What am I doing wrong?

    Thread Starter kalleaume

    (@kalleaume)

    When I tried doing this in theme-my-login-custom.php instead of using Code Snippets, it did not erase the fields that I had added. But it also did not remove the Confirm password field.

    I tried adding it before and after the add_tml_registration_form_fields function, and had the same result.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Sorry, I gave you the incorrect field name. It should be:

    function remove_tml_registration_fields() {
        tml_remove_form_field( 'register', 'user_pass2' );
    }
    add_action( 'init', 'remove_tml_registration_fields' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove ‘Confirm password’ field from registration form’ is closed to new replies.