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:
parent
58d60c5480
commit
f84e660c2c
|
@ -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 ) {
|
||||||
|
|
Loading…
Reference in New Issue