Code Duplication    Length = 16-16 lines in 2 locations

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

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

includes/class-wc-ajax.php 1 location

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