Support » Plugin: Force First and Last Name as Display Name » If Last Name field is empty, but First Name is filled

  • Resolved Suki

    (@sukinoz)


    If only Last Name field is empty, the username is used for “Display name”

    If “First Name” is filled in, shouldn’t this field be used to create the “display name” (even if Last Name is empty)?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Kim Coleman

    (@kimannwall)

    Here’s some code to do just a first name as display name:
    https://gist.github.com/kimcoleman/613b90e6ff2b092318eed48c5b6c04bf

    Thread Starter Suki

    (@sukinoz)

    Sorry, but i think this is not the solution.

    Currently:

    1. If “First Name” and “Last Name” fields are filled:
    The plugin will set the User field “display_name” to their “first and last name”. (GREAT!)

    2. If both “First Name” and “Last Name” fields are empty:
    Display_name will be set to the username. (OBVIUS)

    BUT…
    3. If “First Name” is filled, but “Last Name” is empty:
    Display_name will be set to the username. (NOT THE EXPECTED BEHAVIOUR)

    The expected behaviour would be that in case only “First Name” is filled (and “Last Name” is empty), display_name should be set to the “Firt Name”.

    Dont you think?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘If Last Name field is empty, but First Name is filled’ is closed to new replies.