[wp-hackers] Filter display_name?

Thomas Scholz info at toscho.de
Tue May 18 13:43:49 UTC 2010


Otto:




> On Wed, May 12, 2010 at 9:10 PM, Thomas Scholz <info at toscho.de> wrote:
>>
>> Now I want my users give the ability to decide if this title appears in
>> their public name – so I cannot just add the string to the first name.
>> Unfortunately, the display names to choose from are printed without any
>> filter in /wp-admin/user-edit.php.
>
> Why not use some javascript to modify the contents of it? jQuery is
> loaded on that page, and you can access it easily enough with
> jQuery('#display_name').
>
> The actual value of the element is sent back as is and saved, so
> whatever you change it to will be valid.

Unfortunately, every change on the display name adds a »-2« to the URL  
slug, so I have to dive into the DB anyway to fix those »first-last-2-2-2«  
nonsense. I’ll drop that feature completely until I find the time to  
figure out what exactly happens here.

Regards
Thomas


More information about the wp-hackers mailing list