I'm trying to update user display name when posted through a form.
Here's what I'm trying:
if ( !empty( $_POST['display_name'] ) ){
//var_dump($_POST['display_name'] );
wp_update_user( array ( 'ID' => $current_user->ID, 'display_name' => esc_attr( $_POST['display_name'] ) ) );
}
I can see that the display name is posted correctly, but it just does not update it. I can update the user url successfully but not the display_name and first_name/ last_name. Is there any other way to update these fields?