関数の概要
wp_create_user()は、WordPressデータベースに新しいユーザーを作成するための関数です。
パラメータの説明
- $username (string) – ユーザー名
- $password (string) – パスワード
- $email (string) – メールアドレス
- $userdata (array) – その他のユーザー情報(オプション)
戻り値
新しく作成されたユーザーのIDが返されます。
使用例
$user_id = wp_create_user( 'new_user', 'password123', 'new_user@example.com' );
関連する関数
- wp_insert_user() – ユーザーの情報を更新または新規作成する