Code Duplication    Length = 16-16 lines in 2 locations

includes/class-wc-ajax.php 1 location

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

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
		}