get_next_post/get_previous_post category exclusions still broken
|Reported by:||stewartjohnson||Owned by:|
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.