wp_insert_user($udata) raises PHP warning in wp-admin/menu-header.php ?!
-
The following code both 1) triggers a PHP warning in menu-header.php (which seems whacked out to me), and 2) fails to insert the new user record as desired:
$userdata = array( 'user_login'=> $_POST['username'], 'nickname' => $_POST['nick'], 'user_email'=> $_POST['email'], 'user_pass' => $_POST['password'], 'role' => 'author' ); if( email_exists($userdata['user_email']) == false && username_exists($userdata['user_login'])== false ) { error_log( "name & email do not already exist" ); // do the creation deed $user_id = wp_insert_user($userdata); }
What I can’t figure out is why the devil this code is triggering wp-admin/menu-header.php at all ?
(Note: the usual security precautions have been stripped away during debugging; I do know how to sanitized user input.)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_insert_user($udata) raises PHP warning in wp-admin/menu-header.php ?!’ is closed to new replies.