Merge pull request #2252 from kloon/master

Show selected attributes based on id and not slug in product edit pages.
This commit is contained in:
Coen Jacobs 2013-01-17 00:37:46 -08:00
commit cac5abb118
1 changed files with 1 additions and 1 deletions

View File

@ -384,7 +384,7 @@ function woocommerce_product_data_box() {
$all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' ); $all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' );
if ( $all_terms ) { if ( $all_terms ) {
foreach ( $all_terms as $term ) { foreach ( $all_terms as $term ) {
$has_term = has_term( $term->slug, $attribute_taxonomy_name, $thepostid ) ? 1 : 0; $has_term = has_term( $term->term_id, $attribute_taxonomy_name, $thepostid ) ? 1 : 0;
echo '<option value="' . $term->slug . '" ' . selected( $has_term, 1, false ) . '>' . $term->name . '</option>'; echo '<option value="' . $term->slug . '" ' . selected( $has_term, 1, false ) . '>' . $term->name . '</option>';
} }
} }