Code Duplication    Length = 16-16 lines in 2 locations

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

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

includes/class-wc-ajax.php 1 location

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