#15584 - is_wp_error() checking added to prevent fatal
This commit is contained in:
parent
b3c0e705c9
commit
ab7a3b625c
|
@ -883,7 +883,7 @@ function wc_get_related_products( $product_id, $limit = 5, $exclude_ids = array(
|
|||
*/
|
||||
function wc_get_product_term_ids( $product_id, $taxonomy ) {
|
||||
$terms = get_the_terms( $product_id, $taxonomy );
|
||||
return ! empty( $terms ) ? wp_list_pluck( $terms, 'term_id' ) : array();
|
||||
return !( empty( $terms ) || is_wp_error( $terms ) ) ? wp_list_pluck( $terms, 'term_id' ) : array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue