WordPress.org

Ready to get started?Download WordPress

Forums

Profile Builder - front-end user registration, login and edit profile
[resolved] [Plugin: Profile Builder] Linking "Forgot password" Link to right page (10 posts)

  1. Frederic Pilon
    Member
    Posted 2 years ago #

    Hello there.

    I'm having a little problem linking my custom forgot password page (made with the shortcode [wppb-recover-password]) with the login form in the custom login page made with [wppb-login].

    The link still sends me in the backend at http://www.example.com/wp-login.php?action=lostpassword

    How to change the URL where the forgot password link sends my users?

    BTW, I'm using the free version of the plugin.

    http://wordpress.org/extend/plugins/profile-builder/

  2. nahyanshiwani
    Member
    Posted 1 year ago #

    I'm having the same problem. did u got any solution ??

  3. barinagabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    you can use the built-in filter to change this: wppb_login_url

  4. Anthony
    Member
    Posted 1 year ago #

    okay, I was able to modify wppb.login.php (on line 200)

    Modified to this below:
    $siteURL=get_option('siteurl').'/password-recovery?action=lostpassword';

    That's the first part to the solution, now the other part is when someone actually types in a wrong username or pass, they're prompted with an error message and allows them to recovery the pass but that one points to wp-login (which is what we don't want)

    I found the culprit but I just need help figuring out what to strip, comment or modify?

    I'm guessing it's the code block below.
    <p class="error">
    <?php
    if ( trim($_POST['user-name']) == ''){
    $loginFilterArray['emptyUsernameError'] = ''. __('ERROR:','profilebuilder').' '. __('The username field is empty', 'profilebuilder').'.';
    $loginFilterArray['emptyUsernameError'] = apply_filters('wppb_login_empty_username_error_message', $loginFilterArray['emptyUsernameError']);
    echo $loginFilterArray['emptyUsernameError'];
    }
    if ( is_wp_error($wppb_login) ){
    $loginFilterArray['wpError'] = $wppb_login->get_error_message();
    $loginFilterArray['wpError'] = apply_filters('wppb_login_wp_error_message', $loginFilterArray['wpError'],$wppb_login);
    echo $loginFilterArray['wpError'];
    }
    ?>

  5. constantine.johny
    Member
    Posted 1 year ago #

    barinagabriel:

    you can use the built-in filter to change this: wppb_login_url

    Hi, what do you mean by that? Am not sure if I completely understand. How do I do that?
    Thanks :)

  6. barinagabriel
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    filters are to hook functions on; for instance
    add_filter ('wppb_login_url', 'myFunct', 10, 2);
    function myFunct($oldRedirect, $siteURL){
    /* what you return here will be the new url, as filters have higher priority */

    return '< a href = "'.$siteURL.'/myPasswordRecoveryPageURL " >Recover Pass'< / a >';
    }

    Hope this helps!
    Gabriel

  7. sasha1
    Member
    Posted 1 year ago #

    thanks @barinagabriel.
    Your answer helped.but some changes in your code that made my code working
    what i used is

    add_filter ('wppb_login_url', 'myFunct', 10, 2);
    function myFunct($oldRedirect, $siteURL){
    /* what you return here will be the new url, as filters have higher priority */
    
    return '<a href ="'.home_url().'/forgot-password/">Recover Password</a>';
    }
  8. barinagabriel
    Member
    Plugin Author

    Posted 1 year ago #

    @sasha1,

    didn't the variable $siteURL return the needed base-url? What did it return/what did you need to return?

    Gabriel

  9. sasha1
    Member
    Posted 1 year ago #

    @barinagabriel. no way your code was perfact. i used this because throughout my site i have used home_url().
    only error in your code was some extra ' before </a>.
    Other than that you have delivered the perfact...

  10. barinagabriel
    Member
    Plugin Author

    Posted 1 year ago #

    @sasha1 I have added that extra whitespace in the html tags to make sure it won't get transformed into a link, and thus not displaying the html code anymore.

    Gabriel

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic