Support » Fixing WordPress » wp_insert_user : problem while updating : nothing happens

  • Resolved nicolaskern



    I use the function wp_insert_user() to update user’s settings, but I can’t get it to work.
    Here is my code :

    include '../wordpress-mu/wp-blog-header.php';
    include '../wordpress-mu/wp-includes/registration.php';
    $first_name = htmlentities($_POST['first_name']);
    $last_name = htmlentities($_POST['last_name']);
    $user_email = htmlentities($_POST['user_email']);
    $userdata_new = array();
    $userdata_new['user_pass'] = $current_user->user_pass;
    $userdata_new['user_login'] = $current_user->user_login;
    if (!empty($first_name)) $userdata_new['first_name'] = $first_name;
    if (!empty($last_name)) $userdata_new['last_name'] = $last_name;
    if (!empty($user_email)) $userdata_new['user_email'] = $user_email;

    I don’t really see why it’s not working, I send it an array as it’s required, here is an example of my array $userdata_new :

    Array ( [user_pass] => $P$BSOfnh.OWENyzvWb1nxIGIXRn0WM7W/ [user_login] => admin [user_email] => )

    Thanks a lot for your help,

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘wp_insert_user : problem while updating : nothing happens’ is closed to new replies.