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

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