Use attributes orderby options to sort terms in product's edit screen

This commit is contained in:
Claudio Sanches 2019-05-06 20:39:36 -03:00
parent bd45f865b9
commit 490219de7c
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<select multiple="multiple" data-placeholder="<?php esc_attr_e( 'Select terms', 'woocommerce' ); ?>" class="multiselect attribute_values wc-enhanced-select" name="attribute_values[<?php echo esc_attr( $i ); ?>][]">
<?php
$args = array(
'orderby' => 'name',
'orderby' => ! empty( $attribute_taxonomy->attribute_orderby ) ? $attribute_taxonomy->attribute_orderby : 'name',
'hide_empty' => 0,
);
$all_terms = get_terms( $attribute->get_taxonomy(), apply_filters( 'woocommerce_product_attribute_terms', $args ) );