From 3364dd75c840fb0a3c14241673c2b2b46464a8e0 Mon Sep 17 00:00:00 2001 From: Geert De Deckere Date: Sun, 22 Jan 2012 20:45:08 +0100 Subject: [PATCH] Replacing deprecated "showposts" argument by "posts_per_page" --- widgets/widget-best_sellers.php | 2 +- widgets/widget-featured_products.php | 2 +- widgets/widget-onsale.php | 2 +- widgets/widget-recent_products.php | 2 +- widgets/widget-recently_viewed.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/widgets/widget-best_sellers.php b/widgets/widget-best_sellers.php index 3311df28173..dae921ae760 100644 --- a/widgets/widget-best_sellers.php +++ b/widgets/widget-best_sellers.php @@ -59,7 +59,7 @@ class WooCommerce_Widget_Best_Sellers extends WP_Widget { $number = 15; $query_args = array( - 'showposts' => $number, + 'posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', diff --git a/widgets/widget-featured_products.php b/widgets/widget-featured_products.php index d6db253212c..f3706a25973 100644 --- a/widgets/widget-featured_products.php +++ b/widgets/widget-featured_products.php @@ -61,7 +61,7 @@ class WooCommerce_Widget_Featured_Products extends WP_Widget { $number = 15; ?> - $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes'); + $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes'); $r = new WP_Query($query_args); diff --git a/widgets/widget-onsale.php b/widgets/widget-onsale.php index c05a7452705..587c6797869 100644 --- a/widgets/widget-onsale.php +++ b/widgets/widget-onsale.php @@ -91,7 +91,7 @@ class WooCommerce_Widget_On_Sale extends WP_Widget { $meta_query[] = $woocommerce->query->stock_status_meta_query(); $query_args = array( - 'showposts' => $number, + 'posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', diff --git a/widgets/widget-recent_products.php b/widgets/widget-recent_products.php index 5b689892b65..00b0bbe4177 100644 --- a/widgets/widget-recent_products.php +++ b/widgets/widget-recent_products.php @@ -61,7 +61,7 @@ class WooCommerce_Widget_Recent_Products extends WP_Widget { $show_variations = $instance['show_variations'] ? '1' : '0'; - $query_args = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product'); + $query_args = array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product'); if($show_variations=='0'){ $query_args['meta_query'] = array( diff --git a/widgets/widget-recently_viewed.php b/widgets/widget-recently_viewed.php index 130a9968030..0eb952a8898 100644 --- a/widgets/widget-recently_viewed.php +++ b/widgets/widget-recently_viewed.php @@ -61,7 +61,7 @@ class WooCommerce_Widget_Recently_Viewed extends WP_Widget { else if ( $number > 15 ) $number = 15; - $query_args = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'post__in' => $_SESSION['viewed_products'], 'orderby' => 'rand'); + $query_args = array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'post__in' => $_SESSION['viewed_products'], 'orderby' => 'rand'); $r = new WP_Query($query_args);