I am utilizing the beneath operate which is working for my cellphone and tackle fields. I can not seem to change the e-mail although… any concept what I am doing improper?
operate um_modifications_callback() {
// Guarantee we've the information we have to proceed
if( ! isset( $_POST ) || empty( $_POST ) || ! is_user_logged_in() ) {
// If we do not - return customized error message and exit
header( 'HTTP/1.1 400 Empty POST Values' );
echo 'Might Not Confirm POST Values.';
exit;
}
$user_id = get_current_user_id(); // Get our present person ID
$um_val = sanitize_text_field( $_POST['first_name'] ); // Sanitize our person meta worth
$um_user_email = sanitize_text_field( $_POST['user_email'] ); // Sanitize our person e mail discipline
$cellphone = $_POST['phone'];
$tackle = $_POST['address'];
$e mail = $_POST['user_email'];
update_field('cellphone', $cellphone, 'user_'.$user_id);
update_field('tackle', $tackle, 'user_'.$user_id);
update_user_meta( $user_id, 'first_name', $um_val ); // Replace our person meta
wp_update_user( array(
'ID' => $user_id,
'user_email' => $e mail,
) );
exit;
}