#4304 closed defect (bug) (duplicate)
get_next_post/get_previous_post category exclusions still broken
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.2.1 |
Component: | Template | Keywords: | has-patch |
Focuses: | Cc: |
Description
This was broken up until version 2.1 (see the history of it at RonR's site).
It's still broken in WP 2.1.3. For WP 2.1.3 the code in get_next_post and get_previous_post has some harmless bugs (for example $sql_exclude_cats is declared and never used) but there's one bug preventing the fourth parameter from working correctly at all.
There’s a one line fix for WP2.1.3 to get this code to work. In both functions, this line (lines 294 and 331 in link-template.php):
$sql_cat_ids = " OR pc.category_ID = '$category'";
should be changed to
$sql_cat_ids .= " OR pc.category_ID = '$category'";
(changed = to .=)
I have tested this fix on my own installation and it works correctly.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
SVN patch to fix the bug, and add some missing error checking on intval()