簡體   English   中英

如何從Wordpress中的新用戶歡迎電子郵件中的密碼鏈接中刪除<>字符?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM