[wp-hackers] Problems with wp_update_user() for custom signin, registration, & profile

Mike Schinkel mikeschinkel at newclarity.net
Fri Jan 30 05:33:50 GMT 2009


Hi all:

I'm working on a project as a subcontractor where the client designed a signin and registration process and a user profile that is different enough from the default for WordPress that I am having to practically rewrite it all. Because of this I am realizing that the WordPress login system was very much not designed to be customized (ugh!)  

While I hope to bring the idea to the list in the near future of improving the login system so it can be easily customized (using some of the code I've refactored from wp-login.php, and made somewhat understandable) I am more focused on the immediate problem of trying to get this dag nab thing to work.  Specifically at the moment I'm running into problems not being able to change screen name (which has been specified as a requirement by the client) and not being able to change email address.  I'm trying to follow the "best practices" of using WP functions instead of raw SQL, but can't seem to get anything to work.

The function I've found to use is wp_update_user() from /wp-includes/registration.php but it calls wp_insert_user() and that seems to want to duplicate the user record when I give it a new login names with an existing user ID.  Same is true when I try to change email address. Can anyone please offer some guidance here?  I'm about to give up and just write it in raw SQL if I can't figure this out.

Thanks in advance.

-Mike Schinkel
http://mikeschinkel.com/


More information about the wp-hackers mailing list