From c980c67f7d3dea5db2701c50960629117d2565ed Mon Sep 17 00:00:00 2001 From: John Cotton Date: Thu, 24 Nov 2011 00:55:29 +0000 Subject: [PATCH] The order of slicing then reversing of both the top sellers and top earners arrays meant that the bottom 25 products were displayed, not the top 25. The first asort puts the values in ascending order so slicing first takes the bottom values upwards. By reversing first then slicing we get the top 25 downwards. --- admin/admin-reports.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/admin-reports.php b/admin/admin-reports.php index 308d28f2bbf..9dd4d24903b 100644 --- a/admin/admin-reports.php +++ b/admin/admin-reports.php @@ -887,8 +887,8 @@ function woocommerce_top_sellers() { endif; asort($found_products); - $found_products = array_slice($found_products, 0, 25, true); $found_products = array_reverse($found_products, true); + $found_products = array_slice($found_products, 0, 25, true); reset($found_products); remove_filter( 'posts_where', 'orders_within_range' );