| @@ 48-55 (lines=8) @@ | ||
| 45 | ||
| 46 | $terms = wp_get_post_terms( $product_id, $taxonomy, $args ); |
|
| 47 | ||
| 48 | switch ( $orderby ) { |
|
| 49 | case 'name_num' : |
|
| 50 | usort( $terms, '_wc_get_product_terms_name_num_usort_callback' ); |
|
| 51 | break; |
|
| 52 | case 'parent' : |
|
| 53 | usort( $terms, '_wc_get_product_terms_parent_usort_callback' ); |
|
| 54 | break; |
|
| 55 | } |
|
| 56 | ||
| 57 | switch ( $fields ) { |
|
| 58 | case 'names' : |
|
| @@ 407-414 (lines=8) @@ | ||
| 404 | if ( taxonomy_exists( $taxonomy ) ) { |
|
| 405 | $terms = get_terms( $taxonomy, 'hide_empty=0' ); |
|
| 406 | ||
| 407 | switch ( $tax->attribute_orderby ) { |
|
| 408 | case 'name_num' : |
|
| 409 | usort( $terms, '_wc_get_product_terms_name_num_usort_callback' ); |
|
| 410 | break; |
|
| 411 | case 'parent' : |
|
| 412 | usort( $terms, '_wc_get_product_terms_parent_usort_callback' ); |
|
| 413 | break; |
|
| 414 | } |
|
| 415 | ||
| 416 | $terms_string = implode( ', ', wp_list_pluck( $terms, 'name' ) ); |
|
| 417 | if ( $terms_string ) { |
|