Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 948-963 (lines=16) @@
945
						);
946
					}
947
948
				} elseif ( isset( $attribute_values[ $i ] ) ) {
949
950
					// Text based, possibly separated by pipes (WC_DELIMITER). Preserve line breaks in non-variation attributes.
951
					$values = $is_variation ? wc_clean( $attribute_values[ $i ] ) : implode( "\n", array_map( 'wc_clean', explode( "\n", $attribute_values[ $i ] ) ) );
952
					$values = implode( ' ' . WC_DELIMITER . ' ', wc_get_text_attributes( $values ) );
953
954
					// Custom attribute - Add attribute to array and set the values
955
					$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
956
						'name'         => wc_clean( $attribute_names[ $i ] ),
957
						'value'        => $values,
958
						'position'     => $attribute_position[ $i ],
959
						'is_visible'   => $is_visible,
960
						'is_variation' => $is_variation,
961
						'is_taxonomy'  => $is_taxonomy
962
					);
963
				}
964
965
			 }
966
		}

includes/class-wc-ajax.php 1 location

@@ 713-728 (lines=16) @@
710
						);
711
					}
712
713
				} elseif ( isset( $attribute_values[ $i ] ) ) {
714
715
					// Text based, possibly separated by pipes (WC_DELIMITER). Preserve line breaks in non-variation attributes.
716
					$values = $is_variation ? wc_clean( $attribute_values[ $i ] ) : implode( "\n", array_map( 'wc_clean', explode( "\n", $attribute_values[ $i ] ) ) );
717
					$values = implode( ' ' . WC_DELIMITER . ' ', wc_get_text_attributes( $values ) );
718
719
					// Custom attribute - Add attribute to array and set the values
720
					$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
721
						'name' 			=> wc_clean( $attribute_names[ $i ] ),
722
						'value' 		=> $values,
723
						'position' 		=> $attribute_position[ $i ],
724
						'is_visible' 	=> $is_visible,
725
						'is_variation' 	=> $is_variation,
726
						'is_taxonomy' 	=> $is_taxonomy
727
					);
728
				}
729
730
			 }
731
		}