Notifications
Clear all

[Solved] Would like custom redirect after Forgot Your Password page

3 Posts
2 Users
0 Reactions
218 Views
Posts: 15
 Max7
Topic starter
(@max7)
Eminent Member
Joined: 6 months ago

Some people don't pay attention to the pop-up that an email was sent after they submit the reset password page. I've created a page on my site that only says "Email Sent - Please click the link in the email to set your password" so it's very clear to them. I have put that url in the Custom Redirection URL after registration field and it works great for after a new Registration. But it's not redirecting to my url after an email is sent after they click Reset Password on the /change-password/ page. Is there any function I could add to custom redirect after that page?

2 Replies
Sofy
Posts: 5197
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi,

Please use the hook code below: 

add_filter( 'wpforo_login_url', function( $login_url ) {
    if( strpos( wp_debug_backtrace_summary(), "wpforo\classes\Actions->lostpassword, wpforo_login_url, apply_filters('wpforo_login_url')," ) !== false ){
        $login_url = ' https://example.com ';
    }
    
    return $login_url;
} );

Please change the red-marked value as you like. 

Instruction on How to Easily Add Custom Code in WordPress (Without Breaking Your Site): https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

1 Reply
 Max7
(@max7)
Joined: 6 months ago

Eminent Member
Posts: 15

@sofy thank you! It works perfectly.