Adding the form is not the issue. Removing doesn’t seem to work (yet). I’m just not sure about the priority (for remove). I tried 1, 10, 20 and none (which should be 10), but they all seem to not remove the fields.
This is the code I used.
remove_action( 'register_form', 'password_fields' );
/**
* Outputs my custom password fields to registration form
*
* Callback for "register_form" hook in file "register-form.php", included by Theme_My_Login_Template::display()
*
* @see Theme_My_Login::display()
* @since 6.0
* @access public
*/
function new_password_fields() {
$template = Theme_My_Login::get_object()->get_active_instance();
?>
<p class="tml-user-pass1-wrap">
<label for="pass1<?php $template->the_instance(); ?>"><?php _e( 'Password', 'theme-my-login' ); ?></label>
<input autocomplete="off" name="pass1" id="pass1<?php $template->the_instance(); ?>" class="input" size="20" value="" type="password" placeholder="test" />
</p>
<p class="tml-user-pass2-wrap">
<label for="pass2<?php $template->the_instance(); ?>"><?php _e( 'Confirm Password', 'theme-my-login' ); ?></label>
<input autocomplete="off" name="pass2" id="pass2<?php $template->the_instance(); ?>" class="input" size="20" value="" type="password" />
</p>
<?php
}
add_action( 'register_form', 'new_password_fields', 5 );
Any thoughts ?