WordPress.org

Ready to get started?Download WordPress

Forums

Set a display name format as default (1 post)

  1. modifiedcontent
    Member
    Posted 1 year 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 1 year ago by modifiedcontent
  • This topic is not resolved
  • WordPress version: 3.5.1