woocommerce_get_product_terms bypasses caching

wp_get_object_terms() bypasses the object caching API, which especially hinders the performance of larger shops.
This commit is contained in:
Phill Brown 2012-11-06 17:05:22 +00:00
parent 58d60c5480
commit f84e660c2c
1 changed files with 1 additions and 1 deletions

View File

@ -1171,7 +1171,7 @@ function woocommerce_get_product_terms( $object_id, $taxonomy, $fields = 'all' )
return array(); return array();
$terms = 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' ) ) ); $all_terms = array_flip( get_terms( $taxonomy, array( 'menu_order' => 'ASC', 'fields' => 'ids' ) ) );
switch ( $fields ) { switch ( $fields ) {