最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

user registration - Wordpress is sending an empty email after using wp_insert_user

programmeradmin1浏览0评论

I have some issues with this method:

    funtion AddUser($data){
    $WP_array = array(
        'user_login'            =>  "info here",
        'user_email'            =>  "info here",
        'user_pass'             =>  "info here",
        'first_name'            =>  "info here",
        'last_name'             =>  "info here",
        'role'                  =>  "info here",
        'show_admin_bar_front'  =>  "info here",
    ) ;
    $user_id = wp_insert_user($WP_array);
}

After adding the new user,wordpress automatically sends an empty email D: so what can I do to prevent that, I actually used on my functions.php

add_action( 'init', function() {
    remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
});

Do you have any clue ?

Thank you in advance

I have some issues with this method:

    funtion AddUser($data){
    $WP_array = array(
        'user_login'            =>  "info here",
        'user_email'            =>  "info here",
        'user_pass'             =>  "info here",
        'first_name'            =>  "info here",
        'last_name'             =>  "info here",
        'role'                  =>  "info here",
        'show_admin_bar_front'  =>  "info here",
    ) ;
    $user_id = wp_insert_user($WP_array);
}

After adding the new user,wordpress automatically sends an empty email D: so what can I do to prevent that, I actually used on my functions.php

add_action( 'init', function() {
    remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
});

Do you have any clue ?

Thank you in advance

Share Improve this question asked Aug 13, 2020 at 16:58 Alma FernandaAlma Fernanda 1 2
  • The empty email goes to the user or admin? – mozboz Commented Aug 14, 2020 at 7:37
  • it goes to the user :( – Alma Fernanda Commented Aug 15, 2020 at 5:35
Add a comment  | 

1 Answer 1

Reset to default 0

I think this needs to live inside a plugin and not in functions.php How to turn off email you receive when registered?

发布评论

评论列表(0)

  1. 暂无评论