Code Duplication    Length = 10-10 lines in 2 locations

includes/data-stores/class-wc-product-variable-data-store-cpt.php 1 location

@@ 68-77 (lines=10) @@
65
				}
66
67
				// Check if is a taxonomy attribute.
68
				if ( ! empty( $meta_value['is_taxonomy'] ) ) {
69
					if ( ! taxonomy_exists( $meta_value['name'] ) ) {
70
						continue;
71
					}
72
					$id      = wc_attribute_taxonomy_id_by_name( $meta_value['name'] );
73
					$options = wc_get_object_terms( $product->get_id(), $meta_value['name'], 'term_id' );
74
				} else {
75
					$id      = 0;
76
					$options = wc_get_text_attributes( $meta_value['value'] );
77
				}
78
79
				$attribute = new WC_Product_Attribute();
80
				$attribute->set_id( $id );

includes/data-stores/class-wc-product-data-store-cpt.php 1 location

@@ 452-461 (lines=10) @@
449
				);
450
451
				// Check if is a taxonomy attribute.
452
				if ( ! empty( $meta_value['is_taxonomy'] ) ) {
453
					if ( ! taxonomy_exists( $meta_value['name'] ) ) {
454
						continue;
455
					}
456
					$id      = wc_attribute_taxonomy_id_by_name( $meta_value['name'] );
457
					$options = wc_get_object_terms( $product->get_id(), $meta_value['name'], 'term_id' );
458
				} else {
459
					$id      = 0;
460
					$options = wc_get_text_attributes( $meta_value['value'] );
461
				}
462
463
				$attribute = new WC_Product_Attribute();
464
				$attribute->set_id( $id );