From 793b2dfa69098bac4545e15bb7e99c575b229ba6 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 2 Mar 2017 15:15:41 +0000 Subject: [PATCH] woocommerce_upsells_total filter. Closes #13436 --- includes/wc-template-functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 6eb8e31b7ad..b208f8be053 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -1321,6 +1321,7 @@ if ( ! function_exists( 'woocommerce_upsell_display' ) ) { // Handle orderby and limit results. $orderby = apply_filters( 'woocommerce_upsells_orderby', $orderby ); $upsells = wc_products_array_orderby( $upsells, $orderby, $order ); + $limit = apply_filters( 'woocommerce_upsells_total', $limit ); $upsells = $limit > 0 ? array_slice( $upsells, 0, $limit ) : $upsells; // Set global loop values.