#42261 closed enhancement (wontfix)
Add Support for No Limit Queries to 'posts_per_rss' .
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8.2 |
Component: | Feeds | Keywords: | has-patch has-unit-tests close |
Focuses: | Cc: |
Description
Setting posts_per_rss = -1
will result in a query with LIMIT 0, -1
.
Attachments (3)
Change History (12)
#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' .
@
7 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
@
7 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
.
#7
@
6 years ago
@jorbin @stevenkword updated to code. I was wrong, there was also a spot where this would fail for comments feed. I updated diff to fix this issue and added a unit test for it as well.
#8
@
4 months ago
- Keywords close added
- Resolution set to wontfix
- Status changed from new to closed
Closing this old ticket.
The documentation (https://developer.wordpress.org/reference/classes/wp_query/#pagination-parameters) currently suggests using pre_option_posts_per_rss
to override the limit with PHP_INT_MAX
to get all posts, which is fairly adequate.
Additionally, I am concerned that removing the $q['nopaging'] = false;
technically breaks backcompat, as it would lead to unexpected results if nopaging
set to true
in the query args.
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.).