Skip to content

Commit

Permalink
revised wc_get_product_terms to allow override with args
Browse files Browse the repository at this point in the history
  • Loading branch information
splashingpixels authored and mikejolley committed May 30, 2014
1 parent 06a849c commit 1d783ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion includes/class-wc-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ public function link_all_variations() {
$attribute_field_name = 'attribute_' . sanitize_title( $attribute['name'] );

if ( $attribute['is_taxonomy'] ) {
$options = wc_get_product_terms( $post_id, $attribute['name'], array( 'fields' => 'slugs' ) );
$options = wc_get_product_terms( $post_id, $attribute['name'], array( 'fields' => 'names' ) );
} else {
$options = explode( WC_DELIMITER, $attribute['value'] );
}
Expand Down
6 changes: 3 additions & 3 deletions includes/wc-term-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ function wc_get_product_terms( $product_id, $taxonomy, $args = array() ) {
break;
}
} elseif ( ! empty( $args['orderby'] ) && $args['orderby'] === 'menu_order' ) {
// wp_get_post_terms doens't let us use custom sort order
// wp_get_post_terms doesn't let us use custom sort order
$args['include'] = wp_get_post_terms( $product_id, $taxonomy, array( 'fields' => 'ids' ) );
$args['menu_order'] = isset( $args['order'] ) ? $args['order'] : 'ASC';
$args['hide_empty'] = 0;
$args['fields'] = 'names';
$args['hide_empty'] = isset( $args['hide_empty'] ) ? $args['hide_empty'] : 0;
$args['fields'] = isset( $args['fields'] ) ? $args['fields'] : 'names';

unset( $args['orderby'] );

Expand Down

0 comments on commit 1d783ae

Please sign in to comment.