woocommerce_upsells_total filter.

Closes #13436
This commit is contained in:
Mike Jolley 2017-03-02 15:15:41 +00:00
parent f7fe5812d0
commit 793b2dfa69
1 changed files with 1 additions and 0 deletions

View File

@ -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.