douan3182 2019-08-09 08:17
浏览 224

如何从Wordpress中的新用户欢迎电子邮件中删除密码链接中的<>字符?

The URL to set a password on your new account does not show up in the e-mail sent to new users.

The reason for this is that it is wrapped in the characters <>. The same problem happened in the password reset e-mail, but that was fixed with this solution: https://wordpress.stackexchange.com/questions/246377/missing-url-in-password-reset-email

I can't find a similar filter for the new user password set e-mail. Does anyone know how that can be done?

  • 写回答

1条回答 默认 最新

  • duanlinghe8417 2019-08-09 09:12
    关注

    Use the follows code snippet for new user email -

    function wp_new_user_notification_email( $wp_new_user_notification_email, $user ){
        /* translators: %s: user login */
        $message  = sprintf( __( 'Username: %s' ), $user->user_login ) . "
    
    ";
        $message .= __( 'To set your password, visit the following address:' ) . "
    
    ";
        $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "
    
    ";
    
        $message .= wp_login_url() . "
    ";
    
        $wp_new_user_notification_email['message'] = $message;
    }
    add_filter( 'wp_new_user_notification_email', 'wp_new_user_notification_email', 99, 2 );
    
    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b