Decrease Largo_Related resource use #676
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
get_series_posts()
andget_term_posts()
no longer query for-1
infinite posts in every series associated with the current post, but instead query for the number of posts that will need to be outputted. The previous behavior was to query for the entire collection of posts (sorted by the sort order determined in the series custom landing page), loop over it until the current post was found, and then add posts after that. Now, it queries for the requested number of posts, asking for posts that were published after the current post.count($this->post_ids) >= $this->number
in many places.Why
See #671: Largo_Related was querying for all the posts posts in every series or in every category that a post was in.