| @@ 38-40 (lines=3) @@ | ||
| 35 | ); |
|
| 36 | $all_terms = get_terms( $taxonomy, apply_filters( 'woocommerce_product_attribute_terms', $args ) ); |
|
| 37 | if ( $all_terms ) { |
|
| 38 | foreach ( $all_terms as $term ) { |
|
| 39 | echo '<option value="' . esc_attr( $term->slug ) . '" ' . selected( has_term( absint( $term->term_id ), $taxonomy, $thepostid ), true, false ) . '>' . esc_attr( apply_filters( 'woocommerce_product_attribute_term_name', $term->name, $term ) ) . '</option>'; |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ?> |
|
| 43 | </select> |
|
| @@ 2163-2167 (lines=5) @@ | ||
| 2160 | // Get terms if this is a taxonomy - ordered. We need the names too. |
|
| 2161 | $terms = wc_get_product_terms( $product->id, $attribute, array( 'fields' => 'all' ) ); |
|
| 2162 | ||
| 2163 | foreach ( $terms as $term ) { |
|
| 2164 | if ( in_array( $term->slug, $options ) ) { |
|
| 2165 | $html .= '<option value="' . esc_attr( $term->slug ) . '" ' . selected( sanitize_title( $args['selected'] ), $term->slug, false ) . '>' . esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) ) . '</option>'; |
|
| 2166 | } |
|
| 2167 | } |
|
| 2168 | } else { |
|
| 2169 | foreach ( $options as $option ) { |
|
| 2170 | // This handles < 2.4.0 bw compatibility where text attributes were not sanitized. |
|