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:
commit
cac5abb118
|
@ -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>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue