Updating the values of the profile fields

Once a user clicks on the Update Profile button, all the custom fields need to be saved automatically into the database. So, we have to define another two actions called edit_user_profile_update and personal_options_update. We have to add them inside the constructor of the WPWAF_User class, as shown in the following code:

    add_action('edit_user_profile_update', array($this,  "save_profile_fields"));     add_action('personal_options_update', array($this,  "save_profile_fields")); 

Actions hooks defined in the preceding code are generally used to update additional profile fields. So, we will invoke the save_profile_fields function of a user model to cater to the persisting tasks. Consider the implementation ...

Get Wordpress Web Application Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.