Code Duplication    Length = 6-6 lines in 2 locations

includes/class-wc-order-item-meta.php 2 locations

@@ 127-132 (lines=6) @@
124
				$meta_value    = $meta->value;
125
126
				// If this is a term slug, get the term's nice name
127
				if ( taxonomy_exists( $attribute_key ) ) {
128
					$term = get_term_by( 'slug', $meta_value, $attribute_key );
129
130
					if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) {
131
						$meta_value = $term->name;
132
					}
133
				}
134
135
				$formatted_meta[ $meta_id ] = array(
@@ 171-176 (lines=6) @@
168
				$attribute_key = urldecode( str_replace( 'attribute_', '', $meta_key ) );
169
170
				// If this is a term slug, get the term's nice name
171
				if ( taxonomy_exists( $attribute_key ) ) {
172
					$term = get_term_by( 'slug', $meta_value, $attribute_key );
173
					if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) {
174
						$meta_value = $term->name;
175
					}
176
				}
177
178
				// Unique key required
179
				$formatted_meta_key = $meta_key;