Opened 7 years ago
Last modified 6 years ago
#42261 new enhancement
Add Support for No Limit Queries to 'posts_per_rss' .
Reported by: | ohryan | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.8.2 |
Component: | Feeds | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Setting posts_per_rss = -1
will result in a query with LIMIT 0, -1
.
Attachments (3)
Change History (10)
#1
@
7 years ago
- Keywords needs-patch needs-unit-tests added
- Milestone changed from Awaiting Review to Future Release
- Type changed from defect (bug) to enhancement
#2
@
7 years ago
- Summary changed from Setting posts_per_rss = -1 fails. to Add Support for No Limit Queries to 'posts_per_rss' .
@
6 years ago
Issue was that setting posts_per_page from posts_per_rss should be before checking nopaging and that post_per_page is equal to -1. included unit test in patch.
#4
@
6 years ago
The patch in the test should be updated to not use an anonymous function, and should be reworked in order to not need to be nested.
As mentioned by @stevenkword, comment feeds should also be tested.
#6
@
6 years ago
- Keywords has-patch has-unit-tests added; needs-patch removed
@jorbin @stevenkword I updated the diff and made the filter not a call to an anonymous function. As far as non-post feeds go, this is not related. The bug itself was a bug in get_posts
and setting posts_per_page
from posts_per_rss
, which needed to be checked before nopaging
and that post_per_page
is equal to -1
.
Thank you for the report @ohryan.
As far as I'm aware, there isn't any document that states this query variable supports this value, but that doesn't mean it shouldn't. I simply wouldn't classify this as a bug and more like an enhancement.
I am in favor of supporting the functionality since the variable is passed on to
posts_per_page
inWP_Query
. The problem seems to be more at the "LIMIT" filters which could be updated. This enhancement would require consideration for comment feeds as well.Tests should be written against RSS and Atom and should work for all feeds endpoints (home, custom, comments, custom post types, etc.).