/**
  * Update profile after form submission.
  *
  * @return  void
  * @access  public
  * @static
  * @since   1.0.0
  */
 public static function update_profile()
 {
     $form = new Charitable_Profile_Form();
     if (!$form->validate_nonce() || !$form->validate_honeypot()) {
         charitable_get_notices()->add_error(__('There was an error with processing your form submission. Please reload the page and try again.', 'charitable'));
         return;
     }
     $user = $form->get_user();
     /* Verify that the user is logged in. */
     if (0 == $user->ID) {
         return;
     }
     $fields = $form->get_merged_fields();
     $submitted = apply_filters('charitable_profile_update_values', $_POST, $fields, $form);
     /* Remove the current_pass and user_pass_repeat fields, if set. */
     unset($submitted['current_pass'], $submitted['user_pass_repeat']);
     $valid = $form->check_required_fields($fields);
     if ($valid && $form->is_changing_password()) {
         $valid = $form->validate_password_change();
     }
     if ($valid) {
         $user->update_profile($submitted, array_keys($fields));
         do_action('charitable_profile_updated', $submitted, $fields, $form);
     }
 }
 /**
  * Update profile after form submission. 
  *
  * @return  void
  * @access  public
  * @static
  * @since   1.0.0
  */
 public static function update_profile()
 {
     $form = new Charitable_Profile_Form();
     if (!$form->validate_nonce()) {
         return;
     }
     $user = $form->get_user();
     /* Verify that the user is logged in. */
     if (0 == $user->ID) {
         return;
     }
     $fields = $form->get_merged_fields();
     $submitted = apply_filters('charitable_profile_update_values', $_POST, $fields, $form);
     $valid = $form->check_required_fields($fields);
     if ($valid) {
         $user->update_profile($submitted, array_keys($fields));
         do_action('charitable_profile_updated', $submitted, $fields, $form);
     }
 }
 /**
  * Update profile after form submission. 
  *
  * @return  void
  * @access  public
  * @static
  * @since   1.0.0
  */
 public static function update_profile()
 {
     $form = new Charitable_Profile_Form();
     if (!$form->validate_nonce()) {
         return;
     }
     $user = $form->get_user();
     /* Verify that the user is logged in. */
     if (0 == $user->ID) {
         return;
     }
     $fields = $form->get_merged_fields();
     $submitted = apply_filters('charitable_profile_update_values', $_POST, $fields, $form);
     /* Remove the current_pass and user_pass_repeat fields, if set. */
     unset($submitted['current_pass'], $submitted['user_pass_repeat']);
     $valid = $form->check_required_fields($fields);
     if ($valid && $form->is_changing_password()) {
         $valid = $form->validate_password_change();
     }
     if ($valid) {
         $user->update_profile($submitted, array_keys($fields));
         do_action('charitable_profile_updated', $submitted, $fields, $form);
     }
 }