[wp-hackers] Username Madness

Otto otto at ottodestruct.com
Tue Nov 3 20:36:42 UTC 2009


On Tue, Nov 3, 2009 at 12:11 PM, scribu <scribu at gmail.com> wrote:
> Indeed: If you choose to completely ignore the user interface, you can use
> display_name as yet another nickname.

No... you can choose to use it as the name that gets displayed. This
has nothing to do with "Nickname" whatsoever.

- My Nickname is a piece of information about me.
- My display_name is the name I want to be displayed.

These are not the same thing at all. They're not even close.

> But then, why not just use wp_usermeta to set as many nicknames as you want?

If I were to have more than one nickname, then yes, I'd put them all
in usermeta. The name of the table kinda gives it away, it's the place
where you put "meta" information about the "user".

I've been considering a custom avatar system, and I'd put them in
usermeta too (probably under "avatar"). If I was to make a field
called "phone number", then it'd probably go in usermeta too.

> Then you could hook into 'the_author' and return one of them, instead of
> display_name.

Well, that wouldn't make any sense. There's already a field to be
displayed for a user's name. Oddly enough, it's called "display_name".

Meta = information about information. User-meta is information about
the "user" that is defined as a row in the users table.

Let's try it this way: Information about a user that is needed often
(login name, email, display_name, etc) goes in the user table.
Information about a user that is not needed often (first/last names,
nickname, etc) goes in the usermeta table. If you prefer to think of
it as merely an optimization, then you'd be wrong, but if that helps
you cope with it, fine.

-Otto
Sent from Memphis, TN, United States


More information about the wp-hackers mailing list