Get cached terms from wc_get_related_terms()

This commit is contained in:
Claudio Sanches 2016-10-17 13:28:52 -02:00 committed by Mike Jolley
parent f5c42c60c8
commit ee82a198da
1 changed files with 1 additions and 1 deletions

View File

@ -851,7 +851,7 @@ function wc_get_related_products( $product_id, $limit = 5, $exclude_ids = array(
* @return array
*/
function wc_get_related_terms( $product_id, $taxonomy ) {
$terms = apply_filters( 'woocommerce_get_related_' . $taxonomy . '_terms', wp_get_post_terms( $product_id, $term ), $product_id );
$terms = apply_filters( 'woocommerce_get_related_' . $taxonomy . '_terms', get_the_terms( $product_id, $term ), $product_id );
return array_map( 'absint', wp_list_pluck( $terms, 'term_id' ) );
}