[NSFW] Plugin breaks confirmation email link
-
I send request confirmation new email and link not workin when I enable plugin
https://site.com/wp-admin/profile.php?newuseremail=a71292866c16f723c2b1db08e2257c04New url dashboard – panel
Code request:
$email = sanitize_email($_POST['email']);
$user = wp_get_current_user();
if (email_exists($email)) {
$data = (object)array(
'email ' => $email,
'message' => '',
'errorMessage' => 'The email address is already used'
);
echo json_encode($data);
die();
}
$hash = md5($email . time() . wp_rand());
$new_user_email = array(
'hash' => $hash,
'newemail' => $email,
);
update_user_meta($user->ID, '_new_email', $new_user_email);
$sitename = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$email_text = __(
'Howdy ###USERNAME###,
You recently requested to have the email address on your account changed.
If this is correct, please click on the following link to change it:
###ADMIN_URL###
You can safely ignore and delete this email if you do not want to take this action.
This email has been sent to ###EMAIL###
Regards,
All at ###SITENAME###
###SITEURL###'
);
$content = apply_filters( 'new_user_email_content', $email_text, $new_user_email );
$content = str_replace( '###USERNAME###', $user->user_login, $content );
$content = str_replace( '###ADMIN_URL###', esc_url( self_admin_url( 'profile.php?newuseremail=' . $hash ) ), $content );
$content = str_replace( '###EMAIL###', $email, $content );
$content = str_replace( '###SITENAME###', $sitename, $content );
$content = str_replace( '###SITEURL###', home_url(), $content );
wp_mail( $email, sprintf( __( '[%s] Email Change Request' ), $sitename ), $content );I trying change self_admin_url on new address panel, but link doesn’t work and get 404
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.