[wp-testers] bug did make it in 2.5 (excluding cats from prev/next post links)

deliciousdays oliver.seidel at deliciousdays.com
Sun Mar 30 13:23:32 GMT 2008


Even though I have not received any feedback on the issue I raised 
below, I had hoped someone would have at least looked at it.

I can not so happily confirm that this bug made it into WP2.5, which 
prevents cat exclusions from next/prev post links (get_adjacent_post).

This is specifically important for larger blogs with many objects since 
there can be multiple objects with the same ID, but diff 
term_taxonomy_id 's (e.g. links -> taxonomy=link_category)!

In case you need to get previous_post_link/next_post_link to work again, 
here is a fix:

wp-includes/link-template:  line 556-

            if ( !empty($excluded_categories) ) {
                $posts_in_ex_cats_sql = " AND tt.term_id NOT IN (" . 
implode($excluded_categories, ',') . ') AND tt.taxonomy = "category"';
            }

*AND tt.taxonomy = "category"'* has been added


> It is quite disturbing, that saving a normal post will in fact create 
> two entries in  `wp_term_relationships`. One entry connecting 
> (rightfully so) the post to the category chosen and a second one to a 
> *link-category* ???
>
> It seems to always be the same link category.
>
> For normal blog usage this may be still be ugly but irrelevant but it 
> does break for instance advanced search plugins and possibly other.
>
>
> Oliver
>


More information about the wp-testers mailing list