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

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