Skip to content

Commit

Permalink
Use more specific posts_per_page param
Browse files Browse the repository at this point in the history
Update `Post::get_related_by_taxonomy()` from the more generic `numberposts` param to `posts_per_page`
  • Loading branch information
acobster authored Jul 15, 2019
1 parent 93604a4 commit e54e6ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Conifer/Post/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,13 +500,13 @@ public function get_related_by_taxonomy(
}, $this->terms($taxonomy));

$this->related_by[$taxonomy] = static::get_all([
'post_type' => $this->get_post_type(),
'post__not_in' => [$this->ID],
'numberposts' => $postCount,
'tax_query' => [
'post_type' => $this->get_post_type(),
'post__not_in' => [$this->ID],
'posts_per_page' => $postCount,
'tax_query' => [
[
'taxonomy' => $taxonomy,
'terms' => $termIds,
'taxonomy' => $taxonomy,
'terms' => $termIds,
],
],
]);
Expand Down

0 comments on commit e54e6ad

Please sign in to comment.