Update Display Name Using XProfile Data
-
Hello,
I know that I can change a User’s Display Name via WordPress Hooks.
ie this changes a user’s display name to be their user id on registration:
function update_names( $user_id ) { $data = get_userdata( $user_id ); $username = $data->user_login; wp_update_user( array ( 'ID' => $user_id, 'display_name' => $username, ) ); } add_action( 'user_register', 'update_names' );
I have a XProfile field called “Display Name” (field_id is “1”). What I want to do is:
When a User goes to their Profile Edit page and changes the field, when they click “Save Changes” the system will change ‘display_name’ to the text they entered.
How do I edit the code that fires on profile update?
Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.