Refactor password reset URL handling and email dispatch.

Added optional parameter to `reset_url` for user-specific handling. Updated email dispatch logic to include dynamic generation of the password reset link with proper placeholder replacements.
This commit is contained in:
Mykyta Synelnikov
2025-04-23 14:35:38 +03:00
parent 54deffd244
commit db0da58351
2 changed files with 17 additions and 6 deletions
+7 -3
View File
@@ -36,12 +36,16 @@ if ( ! class_exists( 'um\core\Password' ) ) {
/**
* Get Reset URL
*
* @return bool|string
* @param int|null $user_id
*
* @return string
*/
public function reset_url() {
public function reset_url( $user_id = null ) {
static $reset_key = null;
$user_id = um_user( 'ID' );
if ( is_null( $user_id ) ) {
$user_id = um_user( 'ID' );
}
delete_option( "um_cache_userdata_{$user_id}" );