From 1153794a33716dadb8889c8ecc124997be7a1f1c Mon Sep 17 00:00:00 2001 From: denisbaranov Date: Wed, 15 May 2019 17:08:13 +0300 Subject: [PATCH] Support for the old user tags selected values --- includes/core/class-fields.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index df03a507..8929feb9 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -867,6 +867,24 @@ if ( ! class_exists( 'um\core\Fields' ) ) { if ( ! $field_value ) { $field_value = 0; } + + + // Support for the old user tags values + if( is_numeric( $value ) && is_array( $field_value ) ) { + $type = UM()->fields()->get_field_type( $key ); + if( $type === 'user_tags' ) { + foreach( $field_value as $k => $v ) { + if( is_numeric( $value ) && is_string( $v ) ) { + $term = get_term_by( 'slug', $v, 'um_user_tag' ); + if( $term ) { + $field_value[ $k ] = $term->term_id; + } + } + } + } + } + + if ( $key == 'role' ) {