• 1. I used the filter hook wpmem_login_form_rows let it change the Login form, it changes the Login form ok.
    I used shortcode [wpmem_form password] then the Reset Password form is the same as the Login form, it is changed by wpmem_login_form_rows. There is a silly thing here when the Login Form and Reset Password are affected by wpmem_login_form_rows.
    Now how can I customize each form individually?

    add_filter('wpmem_login_form_rows', 'my_login_form_rows_filter', 10, 2);
    function my_login_form_rows_filter($rows, $action)
    {
        $rows[0] = array(
            'row_before' => '',
            'label' => '<label for="log">メールアドレス</label>',
            'field_before' => '<div class="div_text">',
            'field' => '<input name="log" type="text" id="log" value="" class="username" required="">',
            'field_after' => '</div>',
            'row_after' => '',
        );
    
        $rows[1] = array(
            'row_before' => '',
            'label' => '<label for="pwd">パスワード</label>',
            'field_before' => '<div class="div_text">',
            'field' => '<input name="pwd" type="password" id="pwd" class="password valid" required="" aria-invalid="false">',
            'field_after' => '</div>',
            'row_after' => '',
        );
    
        return $rows;
    }

    2. Is there a way to send a link to change the password to the user when clicked to be redirected to a page that allows to set a new password yourself. Instead of sending new password to user email?
    Thank everyone!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    On #1, the second argument for the function ($action) tells you what form is being produced. You can use that in an “if” condition to determine what you send back. It will be one of the following:

    login
    pwdreset
    pwdchange
    getusername

    See the documentation here for more info:
    https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_login_form_rows/

    Also, a couple of notes. First, I wouldn’t define every value in the array unless you need to. Just change what you are changing and leave the rest unless your changing it. For example, your $rows[0] declaration doesn’t change any of the default values other than the label text, so you only really need it to be this:

    $rows[0]['label'] = '<label for="log">メールアドレス</label>';

    (Similar for the second value).

    And since you’re only changing the label here, the question would be if you’re doing this for translation purposes, it would be better to look into why you need to translate this. If it’s untranslated in the language pack, it would be better to get the language pack updated rather than apply a filter. If it’s that you want something different than what is in the language pack, then it would be better to use the wpmem_default_text filter if all you’re changing is the label text. See: https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_default_text/

    For #2, this is actually going to be a feature update in version 3.3.5. In that release, it will be an option you can enable. In version 3.4.0, it will become the default setting. In 3.5.0, the old password reset will go away completely and the new process will take over.

    3.3.5 is still in development and there are some things being worked out for a couple of other feature items, so it’s not available as an official beta yet. But you can get the development release as it stands now from github here: https://github.com/rocketgeek/wp-members-dev

    Other than any unreported bugs, I think the only thing that is still being worked out in that release is some issues for a related feature update – sending users an activation link when they register. It doesn’t currently recognize existing users as active when that setting is enabled on an existing site. Other than that, the dev copy should be OK for beta testing.

    If you have any questions on the new version, feel free to ask.

    Thread Starter hoangemini

    (@hoangemini)

    @cbutlerjr Thank you very much!
    #1 I did it, it worked fine, I was silly not reading the document and ignoring the $action variable. Good!!!

    #2 So the action of sending a password reset link to the current email has not been done? A little sad.
    I have read here for the function of sending an activation link by email, and it works well. So I thought there was a way to send a similar link to perform a password reset.
    https://rocketgeek.com/filter-hooks/send-new-user-an-activation-link-in-the-new-registration-email/

    I want to ask a little more! is there a way when Login Failed won’t hide the login form. Now it will show wpmem_msg and hide the Login Form, I want it to show both, wpmem_msg above the Login Form

    • This reply was modified 4 years, 4 months ago by hoangemini.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to change layout form Reset Password and send link Reset Password?’ is closed to new replies.