2016-12-23 6 views
0

私は新しいユーザーを作成していて、この関数 "wp_new_user_notification()"を使って新しいユーザーに電子メールを送信したいページテンプレートを作成しました。それは私に何の応答も与えていない。ここでワードプレスwp_new_user_notification()が動作しません

は私のコードです:

if (null == username_exists($user_email)) { 
    include_once (home_url().'/wp-includes/pluggable.php'); 
    // Generate the password and create the user 
    $password = wp_generate_password(12, false); 
    $user_id = wp_create_user($user_email, $password, $user_email); 

    // Email the user 
    wp_new_user_notification($user_id); 
} // end if  
+1

あなたは、テーマのfunctions.phpファイルで作業していますか? – vel

+0

テーマフォルダにページテンプレートがありません –

+1

このファイルをインクルードする必要はありませんinclude_once(home_url()。 '/ wp-includes/pluggable.php'); in theme – vel

答えて

0

あなたはこのように、この機能を使用する必要があります。

wp_new_user_notification($user_id,'','user'); 
+0

Uma Madhavi、あなたは何を答えて編集しましたか? –

関連する問題