diff --git a/core/um-fields.php b/core/um-fields.php index 93e54466..97021825 100644 --- a/core/um-fields.php +++ b/core/um-fields.php @@ -437,6 +437,10 @@ class UM_Fields { return true; } + if ( $field_value && $this->editing == true && !is_array( $field_value ) && html_entity_decode( $field_value ) == html_entity_decode( $value ) ) { + return true; + } + if ( strstr( $data['default'], ', ') ) { $data['default'] = explode(', ', $data['default']); } @@ -455,6 +459,8 @@ class UM_Fields { return true; } + + } } @@ -1554,9 +1560,11 @@ class UM_Fields { foreach($options as $key => $val ) { $val = (string) $val; $val = trim( $val ); - $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_title = '$val'"); - $_role = get_post($post_id); - $new_roles[$_role->post_name] = $_role->post_title; + $post_id = $wpdb->get_var( + $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_title = %s", $val) + ); + $_role = get_post( $post_id ); + $new_roles[ $_role->post_name ] = $_role->post_title; wp_reset_postdata(); } @@ -1586,7 +1594,8 @@ class UM_Fields { $option_value = apply_filters('um_select_dropdown_dynamic_option_value', $option_value); $output .= '';