Wordpress - 寻找禁用用户“新用户注册”电子邮件的代码片段

问题描述 投票:0回答:1

我无法禁用用户尝试设置新密码时收到的注册电子邮件。

我指的是用户收到的“设置新密码...”电子邮件。

我尝试了在网上找到的几个代码片段,但似乎都不起作用。你能帮我解决这个问题吗?

wordpress email notifications new-operator registration
1个回答
0
投票

在注册和编辑用户时发送这些电子邮件的操作被挂在

wp-includes/default-filters.php
中。尝试使用以下代码片段删除它们:

add_action('init', function () {

    remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
    remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );

});
© www.soinside.com 2019 - 2024. All rights reserved.