From e1339fd08c4043f6ca35af2c41069e9a92e7de63 Mon Sep 17 00:00:00 2001 From: rclations Date: Mon, 26 Sep 2016 12:19:39 -0400 Subject: [PATCH] update showposts parameter to posts_per_page --- docs/developers/hooksfilters.rst | 2 +- feed-mailchimp.php | 2 +- homepages/templates/top-stories.php | 8 ++++---- inc/featured-content.php | 2 +- inc/related-content.php | 6 +++--- inc/widgets/largo-recent-posts.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/developers/hooksfilters.rst b/docs/developers/hooksfilters.rst index 62df01a73..6345be0d0 100644 --- a/docs/developers/hooksfilters.rst +++ b/docs/developers/hooksfilters.rst @@ -28,7 +28,7 @@ filter: **largo_homepage_series_stories_list_maximum** filter: **largo_homepage_topstories_post_count** - *args: $showposts* + *args: $posts_per_page* Filter the number of posts that are displayed in the right-hand side of the Top Stories homepage template. diff --git a/feed-mailchimp.php b/feed-mailchimp.php index 5563ffc91..c0020b437 100644 --- a/feed-mailchimp.php +++ b/feed-mailchimp.php @@ -14,7 +14,7 @@ */ $numposts = 20; $posts = query_posts( array( - 'showposts' => $numposts + 'posts_per_page' => $numposts ) ); $lastpost = $numposts - 1; diff --git a/homepages/templates/top-stories.php b/homepages/templates/top-stories.php index 055ddcac5..33c05ec2f 100644 --- a/homepages/templates/top-stories.php +++ b/homepages/templates/top-stories.php @@ -21,7 +21,7 @@ 'terms' => 'top-story' ) ), - 'showposts' => 1 + 'posts_per_page' => 1 ) ); if ( $topstory->have_posts() ) : while ( $topstory->have_posts() ) : $topstory->the_post(); $shown_ids[] = get_the_ID(); @@ -47,8 +47,8 @@
array( array( @@ -57,7 +57,7 @@ 'terms' => 'homepage-featured' ) ), - 'showposts' => $showposts, + 'posts_per_page' => $posts_per_page, 'post__not_in' => $shown_ids ) ); if ( $substories->have_posts() ) : diff --git a/inc/featured-content.php b/inc/featured-content.php index 842424ca3..263afe8ed 100644 --- a/inc/featured-content.php +++ b/inc/featured-content.php @@ -10,7 +10,7 @@ */ function largo_get_featured_posts( $args = array() ) { $defaults = array( - 'showposts' => 3, + 'posts_per_page' => 3, 'offset' => 0, 'orderby' => 'date', 'order' => 'DESC', diff --git a/inc/related-content.php b/inc/related-content.php index 36b4b0c6c..10f0578f1 100644 --- a/inc/related-content.php +++ b/inc/related-content.php @@ -158,7 +158,7 @@ function largo_get_recent_posts_for_term( $term, $max = 5, $min = 1 ) { global $post; $query_args = array( - 'showposts' => $max, + 'posts_per_page' => $max, 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => 1, @@ -185,7 +185,7 @@ function largo_get_recent_posts_for_term( $term, $max = 5, $min = 1 ) { $post_ids = preg_split( '#\s*,\s*#', get_post_meta( $post->ID, 'largo_custom_related_posts', true ) ); $query_args[ 'post__in' ] = $post_ids; $query_args[ 'orderby' ] = 'post__in'; - $query_args['showposts'] = count($post_ids); + $query_args['posts_per_page'] = count($post_ids); } $query_args = apply_filters( 'largo_get_recent_posts_for_term_query_args', $query_args, $term, $max, $min, $post ); @@ -440,7 +440,7 @@ function largo_filter_get_recent_posts_for_term_query_args( $query_args, $term, if ( $term->term_id == -90 ) { $posts = preg_split( '#\s*,\s*#', get_post_meta( $post->ID, 'largo_custom_related_posts', true ) ); $query_args = array( - 'showposts' => $max, + 'posts_per_page' => $max, 'orderby' => 'post__in', 'order' => 'ASC', 'ignore_sticky_posts' => 1, diff --git a/inc/widgets/largo-recent-posts.php b/inc/widgets/largo-recent-posts.php index 7e877b106..a506c9cff 100644 --- a/inc/widgets/largo-recent-posts.php +++ b/inc/widgets/largo-recent-posts.php @@ -55,8 +55,8 @@ function widget( $args, $instance ) { $excerpt = isset( $instance['excerpt_display'] ) ? $instance['excerpt_display'] : 'num_sentences'; $query_args = array ( - 'post__not_in' => get_option( 'sticky_posts' ), - 'showposts' => $instance['num_posts'], + 'post__not_in' => get_option( 'sticky_posts' ), + 'posts_per_page' => $instance['num_posts'], 'post_status' => 'publish' );