Cast term_id as int before using in has_term
As committed in master branch: 7a21dacf5b
This commit is contained in:
parent
e0635a6db7
commit
9ab43587f8
|
@ -388,7 +388,7 @@ function woocommerce_product_data_box() {
|
|||
$all_terms = get_terms( $attribute_taxonomy_name, 'orderby=name&hide_empty=0' );
|
||||
if ( $all_terms ) {
|
||||
foreach ( $all_terms as $term ) {
|
||||
$has_term = has_term( $term->term_id, $attribute_taxonomy_name, $thepostid ) ? 1 : 0;
|
||||
$has_term = has_term( (int) $term->term_id, $attribute_taxonomy_name, $thepostid ) ? 1 : 0;
|
||||
echo '<option value="' . esc_attr( $term->slug ) . '" ' . selected( $has_term, 1, false ) . '>' . $term->name . '</option>';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue