From f84e660c2c23edf1918ca09b3b00f35126a16e02 Mon Sep 17 00:00:00 2001 From: Phill Brown Date: Tue, 6 Nov 2012 17:05:22 +0000 Subject: [PATCH] woocommerce_get_product_terms bypasses caching wp_get_object_terms() bypasses the object caching API, which especially hinders the performance of larger shops. --- woocommerce-core-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woocommerce-core-functions.php b/woocommerce-core-functions.php index 554ce37be3a..fdcd1fd1665 100644 --- a/woocommerce-core-functions.php +++ b/woocommerce-core-functions.php @@ -1171,7 +1171,7 @@ function woocommerce_get_product_terms( $object_id, $taxonomy, $fields = 'all' ) return array(); $terms = array(); - $object_terms = wp_get_object_terms( $object_id, $taxonomy ); + $object_terms = get_the_terms( $object_id, $taxonomy ); $all_terms = array_flip( get_terms( $taxonomy, array( 'menu_order' => 'ASC', 'fields' => 'ids' ) ) ); switch ( $fields ) {