WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 6 months ago

#41931 new feature request

Not possible to add custom display_name option

Reported by: xinne Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.2
Component: Users Keywords: has-patch
Focuses: administration Cc:
PR Number:

Description

In The Netherlands we do have insertion names, to be placed in between the first and last name. It is possible to add a custom field during registration, but in order to give the user the option to include the insertion name in his display_name, a core modification is necessary.

Hereby the request to add a line to wp-admin/user-edit.php at line 422:

<?php
  $public_display = apply_filters( 'edit_user_public_display_dropdown', $public_display, $profileuser);

This way, it is possible to add custom public_display options.

Attachments (1)

41931.patch (2.6 KB) - added by JPry 2 years ago.
First pass at adding filter and cleanup

Download all attachments as: .zip

Change History (5)

#1 @xinne
2 years ago

  • Type changed from enhancement to feature request

#2 @xinne
2 years ago

  • Component changed from Customize to Users

@JPry
2 years ago

First pass at adding filter and cleanup

#3 @JPry
2 years ago

  • Keywords has-patch added

I've added a patch that includes a new filter user_profile_public_display and some formatting cleanup of the surrounding code.

I would be up for adding unit tests if there is a particular example I should follow for filters.

#4 @azaozz
6 months ago

Related #6148. See the proposed solution there to have a single field for user's name. That will change how the display name works (this ticket) too.

Note: See TracTickets for help on using tickets.