admin管理员组文章数量:1426295
I am following this tutorial and have entered in the code exactly as shown. The functions work but they are not displaying any information. When I use var_dump($user_id);
I get this error:
object(WP_Error)#1021 (2) {
["errors"]=> array(1) {
["empty_user_login"]=> array(1) {
[0]=> string(46) "Cannot create a user with an empty login name."
}
}
["error_data"]=> array(0) { }
}
but it is not empty. I have also tried to add it as the documentation states for wp_insert_user()
here and I will populate but no information in the zip code. Any suggestions?
$user_id = wp_insert_user(
array(
'user_login' => $input['testeroo'],
'user_pass' => wp_generate_password ( 12, false ),
'first_name' => $input['first_name'],
'last_name' => $input['last_name'],
'user_email' => $input['email_address'],
'display_name' => $input['first_name'] . ' ' . $input['last_name'],
'nickname' => $input['first_name'] . ' ' . $input['last_name'],
'role' => 'None'
)
);
update_user_meta( $user_id, 'zip_code', $input['zip_code'] );
var_dump($user_id);
本文标签: phpHow To Add Custom User Meta During Registration
版权声明:本文标题:php - How To Add Custom User Meta During Registration 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745446004a2658665.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论