[wp-hackers] Updating a User Record via PHP?

Mike Schinkel mikeschinkel at newclarity.net
Tue Feb 3 00:15:38 GMT 2009


Hmm.  Is that "interface" documented anywhere?  Yes, you documented it in the paragraph below but I mean more details. 

That said, wouldn't you agree that wp-login.php is rather spaghetti code and very difficult to follow? I ended up refactoring to lots of little functions and passing around an array of state and it is not very easy to follow and interact with.

-Mike Schinkel
http://mikeschinkel.com/

----- Original Message -----
From: "DD32" <wordpress at dd32.id.au>
To: wp-hackers at lists.automattic.com
Sent: Monday, February 2, 2009 6:41:05 PM GMT -05:00 US/Canada Eastern
Subject: Re: [wp-hackers] Updating a User Record via PHP?

Your most likely problem is the case of the ID, $id !== $ID, Pass a
valid $ID and the user record gets updated.

You do NOT have to duplicate most of the wp-login.php file at all.
Create a new page, have that as the login form, Create a new page, set
that as the register form, Create a new page, set that as the user
options page.  Add the forms, Next, Set the forms action for the
login/register to wp-login.php SET THE REDIRECTION URL, Next, Add some
code which hooks in on the wp-login page, Redirect to the
login/register forms if someone manually hits the wp-login page, also
add a redirect for a login failure.

It can be done.. I've got about 150 lines of code which i'm using for
that exact purpose (No, I wont release it for client reasons), End
result is a perfectly themed login, how you want it, where you want
it, And no-one ever see's the wp-login.php page.

If you want a thickbox page.. You might want to add a function to your
header.php file to have a "mini header" ie. no sidebar, no huge
logo's, no nothing, just a plain page with styles loaded..


2009/2/3 Mike Schinkel <mikeschinkel at newclarity.net>:
>> Not sure on your ideas for theming the login. This is
>> very simple to accomplish with just images. I generally
>> will create a login/register image to match the client
>> fron-end.
>
> Sadly, theming with images is just lipstick (on a pitbull? sorry, couldn't resist), not functional improvements. :-)
>
> My client wanted a modal dialog (think a "ThickBox" but we used something else), wanted to let users upload and preview their own avatar, and wanted to allow users to fill in some user profile fields all while still in a wizard within the modal.  Try that with images! :-)
>
> I had to take the wp-login.php code and *greatly* refactor it to get it to work. The results is I have something that could be a lot more maintainable and with hooks much more easily incorporated including the ability to capture custom user fields in a wizard-like dialog.
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list