Letting S2Member users change their email address
-
I’m trying to allow users to update their email address from the front-end, without much luck. (ie: Not through the WordPress admin areas, but directly on the site).
This is the code I’m using:
if (isset( $_POST['email'])) { // check if user is really updating the value if ($user_email != $_POST['email']) { // check if email is free to use if (email_exists( $_POST['email'] )){ // Email exists, do not update value. // Maybe output a warning. } else { $args = array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['email'] ) ); wp_update_user( $args ); } } }
But I’m guessing that doesn’t work because S2Member doesn’t use the standard database entries? Can anyone show me how to edit a user’s email address from the front end?
- The topic ‘Letting S2Member users change their email address’ is closed to new replies.