Merge pull request #525 from GeertDD/showposts_deprecated
Replacing deprecated "showposts" argument by "posts_per_page"
This commit is contained in:
commit
862df444c7
|
@ -59,7 +59,7 @@ class WooCommerce_Widget_Best_Sellers extends WP_Widget {
|
||||||
$number = 15;
|
$number = 15;
|
||||||
|
|
||||||
$query_args = array(
|
$query_args = array(
|
||||||
'showposts' => $number,
|
'posts_per_page' => $number,
|
||||||
'nopaging' => 0,
|
'nopaging' => 0,
|
||||||
'post_status' => 'publish',
|
'post_status' => 'publish',
|
||||||
'post_type' => 'product',
|
'post_type' => 'product',
|
||||||
|
|
|
@ -61,7 +61,7 @@ class WooCommerce_Widget_Featured_Products extends WP_Widget {
|
||||||
$number = 15;
|
$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);
|
$r = new WP_Query($query_args);
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class WooCommerce_Widget_On_Sale extends WP_Widget {
|
||||||
$meta_query[] = $woocommerce->query->stock_status_meta_query();
|
$meta_query[] = $woocommerce->query->stock_status_meta_query();
|
||||||
|
|
||||||
$query_args = array(
|
$query_args = array(
|
||||||
'showposts' => $number,
|
'posts_per_page' => $number,
|
||||||
'nopaging' => 0,
|
'nopaging' => 0,
|
||||||
'post_status' => 'publish',
|
'post_status' => 'publish',
|
||||||
'post_type' => 'product',
|
'post_type' => 'product',
|
||||||
|
|
|
@ -61,7 +61,7 @@ class WooCommerce_Widget_Recent_Products extends WP_Widget {
|
||||||
|
|
||||||
$show_variations = $instance['show_variations'] ? '1' : '0';
|
$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'){
|
if($show_variations=='0'){
|
||||||
$query_args['meta_query'] = array(
|
$query_args['meta_query'] = array(
|
||||||
|
|
|
@ -61,7 +61,7 @@ class WooCommerce_Widget_Recently_Viewed extends WP_Widget {
|
||||||
else if ( $number > 15 )
|
else if ( $number > 15 )
|
||||||
$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);
|
$r = new WP_Query($query_args);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue