Add option to allow primary email editable in profile view

This commit is contained in:
champsupertramp
2016-04-02 00:09:59 +08:00
parent a752dae3ac
commit 61ddc340c6
3 changed files with 20 additions and 2 deletions
+7 -1
View File
@@ -909,7 +909,13 @@ class UM_Fields {
if ( !um_can_edit_field( $data ) ) return;
// fields that need to be disabled in edit mode (profile)
if ( in_array( $key, array('user_email','username','user_login','user_password') ) && $this->editing == true && $this->set_mode == 'profile' ) {
$arr_restricted_fields = array('user_email','username','user_login','user_password');
if( um_get_option('editable_primary_email_in_profile') == 1 ){
unset( $arr_restricted_fields[0] ); // remove user_email
}
if ( in_array( $key, $arr_restricted_fields ) && $this->editing == true && $this->set_mode == 'profile' ) {
return;
}