Code Duplication    Length = 16-16 lines in 2 locations

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

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

includes/class-wc-ajax.php 1 location

@@ 732-747 (lines=16) @@
729
						);
730
					}
731
732
				} elseif ( isset( $attribute_values[ $i ] ) ) {
733
734
					// Text based, possibly separated by pipes (WC_DELIMITER). Preserve line breaks in non-variation attributes.
735
					$values = $is_variation ? wc_clean( $attribute_values[ $i ] ) : implode( "\n", array_map( 'wc_clean', explode( "\n", $attribute_values[ $i ] ) ) );
736
					$values = implode( ' ' . WC_DELIMITER . ' ', wc_get_text_attributes( $values ) );
737
738
					// Custom attribute - Add attribute to array and set the values
739
					$attributes[ sanitize_title( $attribute_names[ $i ] ) ] = array(
740
						'name' 			=> wc_clean( $attribute_names[ $i ] ),
741
						'value' 		=> $values,
742
						'position' 		=> $attribute_position[ $i ],
743
						'is_visible' 	=> $is_visible,
744
						'is_variation' 	=> $is_variation,
745
						'is_taxonomy' 	=> $is_taxonomy
746
					);
747
				}
748
749
			 }
750
		}