Skip to content

Commit

Permalink
Correct $value in API
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Oct 19, 2016
1 parent 6b1b962 commit 8903f6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/api/class-wc-rest-products-controller.php
Expand Up @@ -1625,12 +1625,12 @@ protected function save_variations_data( $product, $request ) {

if ( ! empty( $_attribute['is_taxonomy'] ) ) {
// If dealing with a taxonomy, we need to get the slug from the name posted to the API.
$term = get_term_by( 'name', $attribute_value, $attribute_name );
$term = get_term_by( 'name', $value, $attribute_name );

if ( $term && ! is_wp_error( $term ) ) {
$value = $term->slug;
} else {
$value = sanitize_title( $attribute_value );
$value = sanitize_title( $value );
}
}

Expand Down

0 comments on commit 8903f6e

Please sign in to comment.