[wp-trac] [WordPress Trac] #29663: next_post_link & previous_post_link Category exclude broken

WordPress Trac noreply at wordpress.org
Wed Sep 24 16:20:45 UTC 2014


#29663: next_post_link & previous_post_link Category exclude broken
-------------------------------+-----------------------------
 Reporter:  gabrieldiggs       |       Owner:  wonderboymusic
     Type:  defect (bug)       |      Status:  assigned
 Priority:  normal             |   Milestone:  4.0.1
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  template
-------------------------------+-----------------------------

Comment (by gabrieldiggs):

 Replying to [comment:14 posterworld]:
 > hey guys, how are you?
 >
 > I'd been running some test and I found out this:
 >
 > On `link-template.php`, line `1514` is if change this line from WP 4.0
 file:
 >
 > {{{ $where .= " AND p.ID NOT IN ( SELECT object_id FROM
 $wpdb->term_relationships WHERE term_taxonomy_id IN (" . implode(
 $excluded_terms, ',' ) . ') )'; }}}
 >
 > to this one from WP 3.9.2 the exclude works great:
 >
 > {{{ $where = $wpdb->prepare( " AND tt.taxonomy = %s AND tt.term_id NOT
 IN (" . implode( $excluded_terms, ',' ) . ')', $taxonomy ); }}}
 >
 > I have no idea why but it works, I hope this could help you to find out
 what's happening with this.
 >
 > Regards!
 > Pablo
 >
 > PD: Sorry for my lame English.

 @posterworld
 That modification to version 4.0 didn't work for me. I have to use the
 entire link-template.php file from version 3.9.2 in order for the excluded
 posts function to work. I'm waiting on an update from the WordPress
 developers to see how I should proceed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29663#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list