Merge pull request #525 from GeertDD/showposts_deprecated

Replacing deprecated "showposts" argument by "posts_per_page"
This commit is contained in:
Mike Jolley 2012-01-22 16:42:24 -08:00
commit 862df444c7
5 changed files with 5 additions and 5 deletions

View File

@ -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',

View File

@ -61,7 +61,7 @@ class WooCommerce_Widget_Featured_Products extends WP_Widget {
$number = 15;
?>
<?php $query_args = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes');
<?php $query_args = array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => '_featured', 'meta_value' => 'yes');
$r = new WP_Query($query_args);

View File

@ -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',

View File

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

View File

@ -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);