I found a temporary workaround to revive the UM-password-reset function. If I add the following to my function.php:
// Set the email content type to HTML
add_filter( 'wp_mail_content_type', function( $content_type ) {
return "text/html";
});
// Change the password reset email
add_filter( 'retrieve_password_message', 'custom_retrieve_password_message', 10, 4 );
function custom_retrieve_password_message( $message, $key, $user_login, $user_data ) {
$reset_link = network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login');
// Start with your custom message text
$message = '<div style="max-width: 560px; padding: 20px; background: #ffffff; border-radius: 5px; margin: 40px auto; font-family: Open Sans,Helvetica,Arial; font-size: 15px; color: #666;">';
$message .= '<div style="color: #444444; font-weight: normal;"><div style="text-align: center; font-weight: 600; font-size: 26px; padding: 10px 0; border-bottom: solid 3px #eeeeee;">' . get_bloginfo('name') . '</div>';
$message .= '<div style="clear: both;"> </div></div>';
$message .= '<div style="padding: 0 30px 30px 30px; border-bottom: 3px solid #eeeeee;">';
$message .= '<div style="padding: 30px 0; font-size: 24px; text-align: center; line-height: 40px;">Someone requested a password reset for the following account:</div>';
$message .= '<div style="padding: 10px 0 50px 0; text-align: center;"><a style="background: #555555; color: #fff; padding: 12px 30px; text-decoration: none; border-radius: 3px; letter-spacing: 0.3px;" href="' . $reset_link . '">Reset Your Password</a></div>';
$message .= '<div style="padding: 15px; background: #eee; border-radius: 3px; text-align: center;">If you did not make this request, you can ignore this email <a style="color: #3ba1da; text-decoration: none;" href="mailto:' . get_option( 'admin_email' ) . '">or let us know</a>.</div></div>';
$message .= '<div style="color: #999; padding: 20px 30px;"><div>Best Regards</div><div>Your Name</div><div> </div><div><a href="' . site_url() . '" target="_blank" rel="noopener">Your Website</a><br />' . get_option( 'admin_email' ) . '</div></div></div>';
return $message;
}
For some reason the resulting link in the mail then does not really point to the wp-login.php but to the default UM-password-reset again and works. Of course you have to replace the message and placeholders for your needs. But I hope soon I can remove this filter again, when it is fixed.
Edit: Something strange happend now. The password reset works again, without the hook… I am not sure, what happened here.
@michaelpersch
The password reset works again
Do you have caching either a WP Plugin or Web Hosting server or CDN caching active for the UM Pages?
When caching time expired and you got new versions of the Scripts everything went back to normal again.
https://docs.ultimatemember.com/article/1595-caching-problems
I am using W3 Total Cache but I am pretty sure that I purged the cache after the update. I am wondering why it worked as soon as I added the code to the functions.php, as if WordPress reloaded all the hooks in this moment.
Plugin Support
Towhid
(@cryptex_vinci)
Hi @michaelpersch
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards