- This topic has 0 replies, 1 voice, and was last updated 11 years, 6 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › email not updating on front end in user Profile . I checked class.bForm.php
Tagged: email updation on user profile
I want to update email id in user profile all other filed updating but not email
I checked this file class.bForm.php there is a function email()
I think it is working currectly
protected function email() {
global $wpdb;
if (!empty($this->fields[’email’])){
return;
}
$email = filter_input(INPUT_POST, ’email’, FILTER_UNSAFE_RAW);
if (empty($email)) {
$this->errors[’email’] = BUtils::_(‘Email is required’);
return;
}
if (!is_email($email)) {
$this->errors[’email’] = BUtils::_(‘Email is invalid’);
return;
}
$saned = sanitize_email($email);
$query = “SELECT count(member_id) FROM {$wpdb->prefix}swpm_members_tbl WHERE email= %s”;
$member_id = filter_input(INPUT_GET, ‘member_id’, FILTER_SANITIZE_NUMBER_INT);
if (!empty($member_id)) {
$query .= ‘ AND member_id !=%d’;
$result = $wpdb->get_var($wpdb->prepare($query, strip_tags($saned), $member_id));
}
else{
$result = $wpdb->get_var($wpdb->prepare($query, strip_tags($saned)));
}
if ($result > 0) {
if ($saned != $this->fields[’email’]) {
$this->errors[’email’] = BUtils::_(‘Email is already used.’);
return;
}
}
$this->sanitized[’email’] = $saned;
}