Cast term_id as int before using in has_term

As committed in master branch: 7a21dacf5b
This commit is contained in:
Coen Jacobs 2013-05-02 17:11:50 +02:00
parent e0635a6db7
commit 9ab43587f8
1 changed files with 1 additions and 1 deletions

View File

@ -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>';
}
}