| @@ 125-130 (lines=6) @@ | ||
| 122 | $meta_value = $meta->value; |
|
| 123 | ||
| 124 | // If this is a term slug, get the term's nice name |
|
| 125 | if ( taxonomy_exists( $attribute_key ) ) { |
|
| 126 | $term = get_term_by( 'slug', $meta_value, $attribute_key ); |
|
| 127 | ||
| 128 | if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) { |
|
| 129 | $meta_value = $term->name; |
|
| 130 | } |
|
| 131 | } |
|
| 132 | ||
| 133 | $formatted_meta[ $meta_id ] = array( |
|
| @@ 169-174 (lines=6) @@ | ||
| 166 | $attribute_key = urldecode( str_replace( 'attribute_', '', $meta_key ) ); |
|
| 167 | ||
| 168 | // If this is a term slug, get the term's nice name |
|
| 169 | if ( taxonomy_exists( $attribute_key ) ) { |
|
| 170 | $term = get_term_by( 'slug', $meta_value, $attribute_key ); |
|
| 171 | if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) { |
|
| 172 | $meta_value = $term->name; |
|
| 173 | } |
|
| 174 | } |
|
| 175 | ||
| 176 | // Unique key required |
|
| 177 | $formatted_meta_key = $meta_key; |
|
| @@ 288-293 (lines=6) @@ | ||
| 285 | $display_key = wc_attribute_label( $attribute_key, is_callable( array( $this, 'get_product' ) ) ? $this->get_product() : false ); |
|
| 286 | $display_value = $meta->value; |
|
| 287 | ||
| 288 | if ( taxonomy_exists( $attribute_key ) ) { |
|
| 289 | $term = get_term_by( 'slug', $meta->value, $attribute_key ); |
|
| 290 | if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) { |
|
| 291 | $display_value = $term->name; |
|
| 292 | } |
|
| 293 | } |
|
| 294 | ||
| 295 | $formatted_meta[ $meta->id ] = (object) array( |
|
| 296 | 'key' => $meta->key, |
|