[wp-hackers] Username Madness

William Canino william.canino at googlemail.com
Tue Nov 3 18:35:00 UTC 2009


Sorry, scribu. All is great now, IMO.

> But I'm wondering if this isn't a deliberate design choice, for better
> performance

Exactly.

display_name is what the fella or her site's admin wants displayed.
If it is First_name || Last_name || ' - CS Department' then it is so.
"SELECT display_name FROM wp_users" is fast and gives everyone and his
plugins what he expects.  No need for additional case statements or
JOINs or the_author filters or rewrites and all that.

If there is something superfluous in the list, it is wp_usermeta.nickname.

The next superfluous is user_login, if we go rewrite our installation
wizard and registration forms to ask and use the URL-safe nicename to
be the user's login name for WordPress.



2009/11/3 scribu <scribu at gmail.com>:
> I missed a field. Here are all the fields involved:
>
> In wp_users:
>
> user_login - constant
> user_nicename - URL safe
> display_name - computed from other fields
>
> In wp_usermeta: all are editable and optional:
>
> nickname
> first_name
> last_name
>
>
> So, correction:
>
> Also, what if I want my display_name to be something different?
>>
>>
>> You should use user_nicename instead, since that's what it's for.
>>
>
> You should use wp_usermeta.nickname instead of display_name.
>
>
> Only nicename is guaranteed URL safe.  Also, some cultures write their
>> name as 'lastname + firstname'.
>>
>
> As stated above, you can use wp_usermeta.nickname or a filter, and it won't
> interfere with URLs either.
>
>
> I don't care about the DB structure, but please don't eliminate
>> the independent profile field for nickname.
>>
>
> Yeah, nickname won't be going anywhere.
>
>
>
>> -1 on redefining display_name. Deprecate it, if you want. Don't redefine
>> it.
>>
>
> The preference can be easily stored in the usermeta table.
>
> But I'm wondering if this isn't a deliberate design choice, for better
> performance - WPMU comes to mind.
>
>
> --
> http://scribu.net
> _______________________________________________
> 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