Code Duplication    Length = 11-11 lines in 2 locations

includes/admin/meta-boxes/class-wc-meta-box-product-data.php 1 location

@@ 934-944 (lines=11) @@
931
						wp_set_object_terms( $post_id, $values, $attribute_names[ $i ] );
932
					}
933
934
					if ( ! empty( $values ) ) {
935
						// Add attribute to array, but don't set values
936
						$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
937
							'name'         => wc_clean( $attribute_names[ $i ] ),
938
							'value'        => '',
939
							'position'     => $attribute_position[ $i ],
940
							'is_visible'   => $is_visible,
941
							'is_variation' => $is_variation,
942
							'is_taxonomy'  => $is_taxonomy
943
						);
944
					}
945
946
				} elseif ( isset( $attribute_values[ $i ] ) ) {
947

includes/class-wc-ajax.php 1 location

@@ 696-706 (lines=11) @@
693
						wp_set_object_terms( $post_id, $values, $attribute_names[ $i ] );
694
					}
695
696
					if ( $values ) {
697
						// Add attribute to array, but don't set values
698
						$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
699
							'name' 			=> wc_clean( $attribute_names[ $i ] ),
700
							'value' 		=> '',
701
							'position' 		=> $attribute_position[ $i ],
702
							'is_visible' 	=> $is_visible,
703
							'is_variation' 	=> $is_variation,
704
							'is_taxonomy' 	=> $is_taxonomy
705
						);
706
					}
707
708
				} elseif ( isset( $attribute_values[ $i ] ) ) {
709