Home Forums Plugin Support WP User Frontend Pro Update Profile Email

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9508

    Gian Mauro
    Participant
    Post count: 8

    It's possible to verify if email is in use when a user update email profile?
    I would like it to appear an error message and the form was not sent. I think I can do with action hook field…how?? Suggestions?

    #9525

    Tareq Hasan
    Keymaster
    Post count: 2831

    Sorry, currently that wouldn't be possible as there isn't any validation filter available for the profile update.

    #9560

    Gian Mauro
    Participant
    Post count: 8

    What do you think of this solution? If email exists I reset this and I write old email. there is a way to cancel the form-post and / or return a custom error message??

    function my_verify_and_reset_email($user_data) {
    	if (isset($_POST['user_email'])) {
    		$user_info = get_userdata($user_data['ID']);
    		$old_email = $user_info->user_email;
    		if(email_exists($_POST['user_email'])) {			
    			$user_data['user_email'] = $old_email;
    		}        
        }
    	return $user_data;
    }
    add_filter('wpuf_update_profile_vars', 'my_verify_and_reset_email');
    #9565

    Tareq Hasan
    Keymaster
    Post count: 2831

    If the solution works for you, thats definitely good. But as I said, your can't stop the form post and show an error as there isn't any validation filter available for updating user profile.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Update Profile Email’ is closed to new replies.