In this thread it was reported that excluding a category did not work when in_same_cat was TRUE.
On examining the code in wp-includes/link-template.php, I found this line (line 886):
$excluded_categories = array_diff($excluded_categories, $cat_array);
which removes any category ids from $excluded_categories that are in $cat_array (the array of ids that the post is in).
This prevents you from excluding a category that the post is in. I think the $excluded_categories should be removed from $cat_array instead.
Am I missing something?
- The topic ‘Possible bug in previous/next_post_link’ is closed to new replies.