绝对有一个过滤器!
以下是wordpress开发者页面的参考链接:https://developer.wordpress.org/reference/hooks/password_change_email/
基本上是将此函数(带有更改)添加到您的函数中。php将覆盖默认密码重置电子邮件。
apply_filters( \'password_change_email\', array $pass_change_email, array $user, array $userdata )
完整示例:
add_filter( \'password_change_email\', \'rt_change_password_mail_message\', 10, 3 );
function rt_change_password_mail_message( $pass_change_mail, $user, $userdata ) {
$new_message_txt = __( \'Hi [first_name] [last_name],
This notice confirms that your email was changed on on our site.
If you did not change your email, please contact the Site Administrator on our site.
This email has been sent to [user_email]
Regards,
ME\' );
$pass_change_mail[ \'message\' ] = $new_message_txt;
return $pass_change_mail;
}
查看此处的注释,您将看到该消息是
$pass_change_email
大堆所以如果你只是想添加一些东西,试试这个。。。
add_filter( \'password_change_email\', \'rt_change_password_mail_message\', 10, 3 );
function rt_change_password_mail_message( $pass_change_mail, $user, $userdata ) {
$new_message_txt = __( \'new text with phone number\' );
$pass_change_mail[ \'message\' ] = $pass_change_mail[ \'message\' ] . $new_message_txt;
return $pass_change_mail;
}