Ticket #6551 (closed defect (bug): fixed)
get_adjacent_post doesn't exclude categories
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.5.1 |
| Component: | Template | Version: | 2.5 |
| Severity: | normal | Keywords: | needs-patch 2nd-opinion |
| Cc: | filosofo |
Description
So get_previous_post and get_next_post both can't exclude categories.
It would be great to get this into the 2.5 branch, since it's such a simple fix.
Attachments
Change History
- Status changed from new to closed
- Resolution set to fixed
comment:5
TylerMartin — 4 years ago
- Status changed from closed to reopened
- Resolution fixed deleted
The fix doesn't completely fix the problem. Even with the fix in place, if the post in the excluded category is also in any other category, the fact that it is in the excluded category is ignored and the post is not excluded from navigation (which is not the behavior of previous WordPress versions).
- Milestone changed from 2.9 to 2.6.1
I think this error might be related:
[30-Jul-2008 01:18:56] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') WHERE p.post_date > '2007-05-24 17:38:40' AND p.post_type = 'post' AND p.post_' at line 1 for query SELECT p.* FROM blog_posts AS p INNER JOIN blog_term_relationships AS tr ON p.ID = tr.object_id INNER JOIN blog_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'category' AND tt.term_id IN () WHERE p.post_date > '2007-05-24 17:38:40' AND p.post_type = 'post' AND p.post_status = 'publish' AND tt.taxonomy = 'category' ORDER BY p.post_date ASC LIMIT 1 made by get_adjacent_post
- Milestone changed from 2.6.1 to 2.6.2
2.6.1 has been released, moving to 2.6.2 milestone
- Keywords has-patch, removed
- Milestone changed from 2.7 to 2.8
No patch for current problem, moving to 2.8.
- Milestone changed from 2.8 to Future Release
db error described by scribu no longer should occur in trunk based on what I'm reading.
whether the behavior described by TylerMartin is correct is debatable.
- Keywords needs-patch 2nd-opinion added; get_adjacent_post, get_previous_post, get_next_post removed
- Status changed from reopened to closed
- Version changed from 2.6 to 2.5
- Resolution set to fixed
- Milestone changed from Future Release to 2.5.1

