Support » Plugin: Theme My Login » Filter available to add placeholders for passwords ?

  • Resolved Beee

    (@beee)


    Is there a filter or action available so I can add a placeholder to the first password input form in do_action(‘register_form’) ?

    Tried some things, but can’t make it work.

    • This topic was modified 1 year, 10 months ago by  Beee.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    You can remove TML’s callback for adding them and add your own.

    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 ?

    As a temporary workaround, I commented line 38 in custom-passwords.php but this is not ideal of course.

    Same with this issue. I have a work-around but it’s not ideal.

    Can you help me out here maybe ?

    Jeff can you give me some intel on how to remove this action ? I can’t seem to do it.

    Still hoping for an answer…

    Plugin Author Jeff Farthing

    (@jfarthing84)

    
    remove_action( 'register_form', array( Theme_My_Login_Custom_Passwords::get_object(), 'password_fields' ) );
    

    Awesome. That did the trick, thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Filter available to add placeholders for passwords ?’ is closed to new replies.