[API] Fixed the default attributes saving

This commit is contained in:
Claudio Sanches 2015-01-19 11:33:33 -02:00
parent 33e046a4d0
commit 07e6996bf1
1 changed files with 5 additions and 1 deletions

View File

@ -1388,7 +1388,11 @@ class WC_API_Products extends WC_API_Resource {
continue;
}
$taxonomy = $this->get_attribute_taxonomy_by_slug( $default_attr['name'] );
$taxonomy = sanitize_title( $attribute['name'] );
if ( isset( $attribute['slug'] ) ) {
$taxonomy = $this->get_attribute_taxonomy_by_slug( $attribute['slug'] );
}
if ( isset( $attributes[ $taxonomy ] ) ) {
$_attribute = $attributes[ $taxonomy ];