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