![](/img/trans.png)
[英]How can I get the current Wordpress e-mail address of a logged-in user in an external php file?
[英]How can I remove the <> characters from the password link in the new user welcome e-mail in Wordpress?
发送给新用户的电子邮件中不会显示用于在新帐户上设置密码的URL。
原因是它被包裹在字符<>中。 密码重置电子邮件中发生了相同的问题,但是此解决方案已解决: https : //wordpress.stackexchange.com/questions/246377/missing-url-in-password-reset-email
我找不到用于新用户密码集电子邮件的类似过滤器。 有谁知道该怎么做?
将以下代码段用于新用户电子邮件-
function wp_new_user_notification_email( $wp_new_user_notification_email, $user ){
/* translators: %s: user login */
$message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
$message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n";
$message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "\r\n\r\n";
$message .= wp_login_url() . "\r\n";
$wp_new_user_notification_email['message'] = $message;
}
add_filter( 'wp_new_user_notification_email', 'wp_new_user_notification_email', 99, 2 );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.