mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Merge remote-tracking branch 'remotes/origin/fix/helpscout#28332_fix_select_valuer_0'
This commit is contained in:
@@ -843,6 +843,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
if ( ! isset( UM()->form()->post_form[ $key ] ) ) {
|
||||
|
||||
$field_value = um_user( $key );
|
||||
if( isset($field_value) && !$field_value ){
|
||||
$field_value = 0;
|
||||
}
|
||||
|
||||
if ( $key == 'role' ) {
|
||||
|
||||
@@ -905,8 +908,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
if ( $field_value && $this->editing == true && is_array( $field_value ) && ( in_array( $value, $field_value ) || in_array( html_entity_decode( $value ), $field_value ) ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( $field_value == 0 && $this->editing == true && ! is_array( $field_value ) && $field_value == $value ) {
|
||||
return true;
|
||||
}
|
||||
if ( $field_value && $this->editing == true && ! is_array( $field_value ) && $field_value == $value ) {
|
||||
echo $field_value;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1672,7 +1672,11 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
foreach ( $changes as $key => $value ) {
|
||||
if ( ! in_array( $key, $this->update_user_keys ) ) {
|
||||
update_user_meta( $this->id, $key, $value );
|
||||
if( $value === 0 ){
|
||||
update_user_meta( $this->id, $key, '0' );
|
||||
} else {
|
||||
update_user_meta( $this->id, $key, $value );
|
||||
}
|
||||
} else {
|
||||
$args[ $key ] = esc_attr( $changes[ $key ] );
|
||||
}
|
||||
|
||||
@@ -218,6 +218,7 @@ function um_user_edit_profile( $args ) {
|
||||
|
||||
// loop through fields
|
||||
if ( ! empty( $fields ) ) {
|
||||
|
||||
foreach ( $fields as $key => $array ) {
|
||||
|
||||
if ( ! um_can_edit_field( $array ) && isset( $array['editable'] ) && ! $array['editable'] ) {
|
||||
@@ -229,6 +230,7 @@ function um_user_edit_profile( $args ) {
|
||||
}
|
||||
|
||||
if ( isset( $args['submitted'][ $key ] ) ) {
|
||||
|
||||
if ( isset( $array['type'] ) && in_array( $array['type'], array( 'image', 'file' ) ) &&
|
||||
( /*um_is_file_owner( UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . '/' . $args['submitted'][ $key ], um_user( 'ID' ) ) ||*/
|
||||
um_is_temp_file( $args['submitted'][ $key ] ) || $args['submitted'][ $key ] == 'empty_file' ) ) {
|
||||
@@ -236,14 +238,13 @@ function um_user_edit_profile( $args ) {
|
||||
$files[ $key ] = $args['submitted'][ $key ];
|
||||
|
||||
} else {
|
||||
|
||||
if ( $array['type'] == 'password' ) {
|
||||
$to_update[ $key ] = wp_hash_password( $args['submitted'][ $key ] );
|
||||
$args['submitted'][ $key ] = sprintf( __( 'Your choosed %s', 'ultimate-member' ), $array['title'] );
|
||||
} else {
|
||||
if ( isset( $userinfo[ $key ] ) && $args['submitted'][ $key ] != $userinfo[ $key ] ) {
|
||||
$to_update[ $key ] = $args['submitted'][ $key ];
|
||||
} elseif ( $args['submitted'][ $key ] ) {
|
||||
} elseif ( $args['submitted'][ $key ] != '' ) {
|
||||
$to_update[ $key ] = $args['submitted'][ $key ];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user