Set a display name format as default (1 post)

  1. Modifiedcontent
    Posted 3 years ago #

    Is there a way to set the display name format with a line of PHP in functions.php or the registration process?

    There are plenty hacks to get 'Firstname Lastname' into the display_name field in the database. This question is about setting the format -> 'Display name publicly as' in the dashboard.

    How can you set that format programmatically as a default for every user across the site/network? It now seems to default to the username.

    I think this query sets the format to first_name as default:

    UPDATE wp_users, wp_usermeta
    SET display_name = meta_value
    WHERE ID = user_id
    AND meta_key = 'first_name'

    So I would need a variation of this? Does it really require a database change? Won't this create other problems?

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by Modifiedcontent
  • This topic is not resolved
  • WordPress version: 3.5.1