wpdb update user_login also updates user_nicename
-
I set up a feature to enable the admin level user of my site to change a user’s user_login in the wordpress users table. The admin can enter a new user name from the user’s profile screen in the dashboard.
My code uses wpdb to update the user_login field for the user’s row in the users table. However, wordpress also updates the user_nicename field, adding a “-2” to the end each time I update the user_login field.
ex. nicename before update
user-xex. nicename after 1st update
user-x-2ex. nicename after 2nd update
user-x-2-2My update set clause only sets a value for user_login not user_nicename.
Why does wordpress do this, and is there a way to prevent wordpress from updating the user_nicename field?
- The topic ‘wpdb update user_login also updates user_nicename’ is closed to new replies.