As user profiles are created or updated, WordPress offers an easy way to register a callback to save custom user data in the site's database. This recipe shows how to use this action hook.
Processing and storing user custom data
Getting ready
You should have already followed the Adding custom fields to the user editor recipe to have a starting point for this recipe and the resulting plugin should still be active in your development site. Alternatively, you can get the resulting code (Chapter 7/ch2-private-item-text/ch2-private-item-text-v3.php) from the downloaded code bundle, renaming it as ch2-private-item-text.php.