Change default ordering of display name

AFAIK the default option in the display name dropdown is set to the current value of user display name. So, if we on user creation set display_name to “Lastname Firstname”, then this will be used as default. This can be done hooking user_register: add_action(‘user_register’, ‘last_name_first’); function last_name_first( $uid ) { remove_action(‘user_register’, ‘last_name_first’); $user = new … Read more

How to change a username?

Answer originally posted on another question which was more “why we can’t” instead of “how”: https://web.archive.org/web/20210408084000/https://wordpress.stackexchange.com/questions/135304/why-cant-i-update-username-through-wordpress-api/386265 Here is the solution I used to change the username properly (based on https://www.wpbeginner.com/wp-tutorials/how-to-change-your-wordpress-username/ which had missing information): I was able to change the username simply with SQL using update wp_users set user_login = “old_username”, user_nicename = “new_username” where … Read more

How to translate “ERROR: Invalid username. Lost your password?”

In the en_GB version of the .mo translation file, this string is available: <strong>ERROR</strong>: Invalid username. <a href=\”%s\” title=\”Password Lost and Found\”>Lost your password</a>? and the reference is from wp-includes/user.php on line 93. I found this using Poedit and searching using Ctrl + F. From line 93 we get the following code: return new WP_Error( … Read more