320fb3f8 by Kevin Burton

only use WP user_email in User Admin Functionality

1 parent ef173d5e
......@@ -237,7 +237,11 @@ class ProfileValidation extends Common\Validation {
} else {
throw new Exception('Email field can not be empty');
}
update_user_meta($_POST['uid'], 'email', $val);
// update user email.
wp_update_user( Array ('ID'=>$_POST['uid'] , 'user_email'=>$val) );
//update_user_meta($_POST['uid'], 'email', $val);
}
public function company($val) {
......@@ -408,6 +412,7 @@ class Actions {
, 'country' => $_POST['country']
, 'email' => $email
);
unset($user_details['email']);
if (isset($_POST['member_id'])) { $user_details['member_id'] = $_POST['member_id']; }
$user_details = array_merge(User\Vars::$meta_defaults, $user_details);
......
......@@ -13,6 +13,14 @@ use Exception, StdClass;
use WP_User;
$user = new WP_User($_GET['uid']);
/*
print "<pre>";
print_r($user);
print "</pre>";
*/
reset($user->roles);
$role = current($user->roles);
......
......@@ -29,7 +29,7 @@ $country = get_user_meta($uid, 'country', true);
$phone = get_user_meta($uid, 'phone', true);
$fax = get_user_meta($uid, 'fax', true);
$mobile = get_user_meta($uid, 'mobile', true);
$email = get_user_meta($uid, 'email', true);
$email = $user->user_email;//get_user_meta($uid, 'email', true);
// professional stuff
$title = get_user_meta($uid, 'title', true);
......
......@@ -134,7 +134,7 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
</tr>
<tr>
<th>Email:</th>
<td><input type="text" name="email" value="<?php echo get_user_meta($_GET['uid'], 'email', true);?>" /></td>
<td><input type="text" name="email" value="<?php echo $user->user_email;?>" /></td>
</tr>
<tr>
<th>Mobile:</th>
......@@ -157,7 +157,7 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true);
<td>
<select name="email_address_preference">
<?php
$email = get_user_meta($_GET['uid'],'email',true);
$email = $user->user_email;
?>
<option value="none" <?php echo ($preference=="none") ? "selected" : "";?>>None</option>
<?php if(!empty($email)): ?><option value="email" <?php echo ($preference=="email") ? "selected" : "";?>><?php echo $email;?></option><?php endif;?>
......